-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
31 lines (23 loc) · 966 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using JokeTrader;
using JokeTrader.Services;
using JokeTrader.Torch;
using Microsoft.EntityFrameworkCore;
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddOptions<JokerOption>();
builder.Services.AddBybit();
builder.Services.AddDbContextFactory<JokerContext>(
options => options.UseSqlServer(
builder.Configuration.GetConnectionString("DefaultConnection"))
.EnableDetailedErrors()
.EnableSensitiveDataLogging());
builder.Services.AddTransient<SymbolService>();
builder.Services.AddTransient<KLineService>();
builder.Services.AddTransient<RatioService>();
builder.Services.AddTransient<FundRateService>();
builder.Services.AddTransient<InterestService>();
builder.Services.AddTransient<ZScoreService>();
builder.Services.AddSingleton<JokerDataLoader>();
builder.Services.AddSingleton<TrainService>();
builder.Services.AddHostedService<Orchestration>();
var app = builder.Build();
await app.RunAsync();