feat(TA): update technical analysis service

This commit is contained in:
2026-08-09 21:01:42 +02:00
parent 05d55a324c
commit c74a4456af
18 changed files with 2288 additions and 0 deletions
@@ -0,0 +1,162 @@
// <auto-generated />
using System;
using FinlyticTechnicalAnalysis.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace FinlyticTechnicalAnalysis.Migrations
{
[DbContext(typeof(TechnicalAnalysisDbContext))]
[Migration("20260801073352_Init")]
partial class Init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("FinlyticTechnicalAnalysis.Entities.CachedAnalysisEntity", b =>
{
b.Property<string>("Isin")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<string>("AnalysisJson")
.IsRequired()
.HasColumnType("jsonb");
b.Property<DateTime>("CalculatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Ticker")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.HasKey("Isin");
b.HasIndex("Isin");
b.ToTable("CachedAnalyses");
});
modelBuilder.Entity("FinlyticTechnicalAnalysis.Entities.MacroDataEntity", b =>
{
b.Property<string>("Symbol")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<DateTime>("LastUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("PreviousClose")
.HasColumnType("decimal(18, 6)");
b.Property<string>("TrendState")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<decimal>("Value")
.HasColumnType("decimal(18, 6)");
b.HasKey("Symbol");
b.ToTable("MacroData");
});
modelBuilder.Entity("FinlyticTechnicalAnalysis.Entities.MarketCandleEntity", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal?>("Ask")
.HasColumnType("decimal(18, 6)");
b.Property<decimal?>("Bid")
.HasColumnType("decimal(18, 6)");
b.Property<decimal>("Close")
.HasColumnType("decimal(18, 6)");
b.Property<decimal>("High")
.HasColumnType("decimal(18, 6)");
b.Property<string>("Interval")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("character varying(10)");
b.Property<decimal>("Low")
.HasColumnType("decimal(18, 6)");
b.Property<decimal>("Open")
.HasColumnType("decimal(18, 6)");
b.Property<string>("Symbol")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
b.Property<long>("Volume")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("Symbol", "Interval", "Timestamp")
.IsUnique();
b.ToTable("MarketCandles");
});
modelBuilder.Entity("FinlyticTechnicalAnalysis.Entities.TaSettingsEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("EmaShortPeriod")
.HasColumnType("integer");
b.Property<double>("RsiOverboughtLimit")
.HasColumnType("double precision");
b.Property<double>("RsiOversoldLimit")
.HasColumnType("double precision");
b.Property<int>("SmaLongPeriod")
.HasColumnType("integer");
b.Property<int>("SmaMediumPeriod")
.HasColumnType("integer");
b.Property<double>("SupertrendMultiplier")
.HasColumnType("double precision");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Settings");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,112 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace FinlyticTechnicalAnalysis.Migrations
{
/// <inheritdoc />
public partial class Init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CachedAnalyses",
columns: table => new
{
Isin = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
Ticker = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
AnalysisJson = table.Column<string>(type: "jsonb", nullable: false),
CalculatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CachedAnalyses", x => x.Isin);
});
migrationBuilder.CreateTable(
name: "MacroData",
columns: table => new
{
Symbol = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
Value = table.Column<decimal>(type: "numeric(18,6)", nullable: false),
PreviousClose = table.Column<decimal>(type: "numeric(18,6)", nullable: false),
TrendState = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
LastUpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_MacroData", x => x.Symbol);
});
migrationBuilder.CreateTable(
name: "MarketCandles",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Symbol = table.Column<string>(type: "character varying(20)", maxLength: 20, nullable: false),
Interval = table.Column<string>(type: "character varying(10)", maxLength: 10, nullable: false),
Timestamp = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Open = table.Column<decimal>(type: "numeric(18,6)", nullable: false),
High = table.Column<decimal>(type: "numeric(18,6)", nullable: false),
Low = table.Column<decimal>(type: "numeric(18,6)", nullable: false),
Close = table.Column<decimal>(type: "numeric(18,6)", nullable: false),
Volume = table.Column<long>(type: "bigint", nullable: false),
Bid = table.Column<decimal>(type: "numeric(18,6)", nullable: true),
Ask = table.Column<decimal>(type: "numeric(18,6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MarketCandles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Settings",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
EmaShortPeriod = table.Column<int>(type: "integer", nullable: false),
SmaMediumPeriod = table.Column<int>(type: "integer", nullable: false),
SmaLongPeriod = table.Column<int>(type: "integer", nullable: false),
RsiOverboughtLimit = table.Column<double>(type: "double precision", nullable: false),
RsiOversoldLimit = table.Column<double>(type: "double precision", nullable: false),
SupertrendMultiplier = table.Column<double>(type: "double precision", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Settings", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_CachedAnalyses_Isin",
table: "CachedAnalyses",
column: "Isin");
migrationBuilder.CreateIndex(
name: "IX_MarketCandles_Symbol_Interval_Timestamp",
table: "MarketCandles",
columns: new[] { "Symbol", "Interval", "Timestamp" },
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CachedAnalyses");
migrationBuilder.DropTable(
name: "MacroData");
migrationBuilder.DropTable(
name: "MarketCandles");
migrationBuilder.DropTable(
name: "Settings");
}
}
}
@@ -0,0 +1,159 @@
// <auto-generated />
using System;
using FinlyticTechnicalAnalysis.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace FinlyticTechnicalAnalysis.Migrations
{
[DbContext(typeof(TechnicalAnalysisDbContext))]
partial class TechnicalAnalysisDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("FinlyticTechnicalAnalysis.Entities.CachedAnalysisEntity", b =>
{
b.Property<string>("Isin")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<string>("AnalysisJson")
.IsRequired()
.HasColumnType("jsonb");
b.Property<DateTime>("CalculatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Ticker")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.HasKey("Isin");
b.HasIndex("Isin");
b.ToTable("CachedAnalyses");
});
modelBuilder.Entity("FinlyticTechnicalAnalysis.Entities.MacroDataEntity", b =>
{
b.Property<string>("Symbol")
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<DateTime>("LastUpdatedAt")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("PreviousClose")
.HasColumnType("decimal(18, 6)");
b.Property<string>("TrendState")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<decimal>("Value")
.HasColumnType("decimal(18, 6)");
b.HasKey("Symbol");
b.ToTable("MacroData");
});
modelBuilder.Entity("FinlyticTechnicalAnalysis.Entities.MarketCandleEntity", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
b.Property<decimal?>("Ask")
.HasColumnType("decimal(18, 6)");
b.Property<decimal?>("Bid")
.HasColumnType("decimal(18, 6)");
b.Property<decimal>("Close")
.HasColumnType("decimal(18, 6)");
b.Property<decimal>("High")
.HasColumnType("decimal(18, 6)");
b.Property<string>("Interval")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("character varying(10)");
b.Property<decimal>("Low")
.HasColumnType("decimal(18, 6)");
b.Property<decimal>("Open")
.HasColumnType("decimal(18, 6)");
b.Property<string>("Symbol")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
b.Property<long>("Volume")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("Symbol", "Interval", "Timestamp")
.IsUnique();
b.ToTable("MarketCandles");
});
modelBuilder.Entity("FinlyticTechnicalAnalysis.Entities.TaSettingsEntity", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("EmaShortPeriod")
.HasColumnType("integer");
b.Property<double>("RsiOverboughtLimit")
.HasColumnType("double precision");
b.Property<double>("RsiOversoldLimit")
.HasColumnType("double precision");
b.Property<int>("SmaLongPeriod")
.HasColumnType("integer");
b.Property<int>("SmaMediumPeriod")
.HasColumnType("integer");
b.Property<double>("SupertrendMultiplier")
.HasColumnType("double precision");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Settings");
});
#pragma warning restore 612, 618
}
}
}