code cleanup
parent
941e00e346
commit
43ba83aa90
|
@ -20,7 +20,6 @@ using System.Collections.Concurrent;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Threading.Channels;
|
using System.Threading.Channels;
|
||||||
using Tinkoff.InvestApi;
|
using Tinkoff.InvestApi;
|
||||||
using Tinkoff.InvestApi.V1;
|
|
||||||
using AssetType = KLHZ.Trader.Core.Exchange.Models.AssetsAccounting.AssetType;
|
using AssetType = KLHZ.Trader.Core.Exchange.Models.AssetsAccounting.AssetType;
|
||||||
|
|
||||||
namespace KLHZ.Trader.Core.Exchange.Services
|
namespace KLHZ.Trader.Core.Exchange.Services
|
||||||
|
@ -267,7 +266,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -448,7 +447,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
||||||
var sells = sberSells.Sum(s => s.Value);
|
var sells = sberSells.Sum(s => s.Value);
|
||||||
var buys = sberBuys.Sum(s => s.Value);
|
var buys = sberBuys.Sum(s => s.Value);
|
||||||
var su = sells + buys;
|
var su = sells + buys;
|
||||||
if (su!=0)
|
if (su != 0)
|
||||||
{
|
{
|
||||||
var dsell = (sells / su - 0.5m) * 2;
|
var dsell = (sells / su - 0.5m) * 2;
|
||||||
}
|
}
|
||||||
|
@ -629,7 +628,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
||||||
ExchangeState state,
|
ExchangeState state,
|
||||||
INewPrice message, int windowMaxSize)
|
INewPrice message, int windowMaxSize)
|
||||||
{
|
{
|
||||||
if (data.timestamps.Length <= 4 || state!=ExchangeState.Open)
|
if (data.timestamps.Length <= 4 || state != ExchangeState.Open)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -713,7 +712,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
||||||
ExchangeState state,
|
ExchangeState state,
|
||||||
INewPrice message, int windowMaxSize, decimal step)
|
INewPrice message, int windowMaxSize, decimal step)
|
||||||
{
|
{
|
||||||
if (data.timestamps.Length <= 4 && state !=ExchangeState.Open)
|
if (data.timestamps.Length <= 4 && state != ExchangeState.Open)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -950,7 +949,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
||||||
if (LocalTrends.TryCalcTrendDiff(largeData.timestamps, largeData.prices, out var largeDataRes)
|
if (LocalTrends.TryCalcTrendDiff(largeData.timestamps, largeData.prices, out var largeDataRes)
|
||||||
&& LocalTrends.TryCalcTrendDiff(smallData.timestamps, smallData.prices, out var smallDataRes))
|
&& LocalTrends.TryCalcTrendDiff(smallData.timestamps, smallData.prices, out var smallDataRes))
|
||||||
{
|
{
|
||||||
if (largeDataRes>0 && largeDataRes <= 4 && System.Math.Abs(smallDataRes)<3)
|
if (largeDataRes > 0 && largeDataRes <= 4 && System.Math.Abs(smallDataRes) < 3)
|
||||||
{
|
{
|
||||||
res = TradingMode.Stable;
|
res = TradingMode.Stable;
|
||||||
}
|
}
|
||||||
|
@ -958,7 +957,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
||||||
{
|
{
|
||||||
res = TradingMode.SlowDropping;
|
res = TradingMode.SlowDropping;
|
||||||
}
|
}
|
||||||
if (largeDataRes>5 && smallDataRes > 0)
|
if (largeDataRes > 5 && smallDataRes > 0)
|
||||||
{
|
{
|
||||||
res = TradingMode.Growing;
|
res = TradingMode.Growing;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace KLHZ.Trader.Service.Controllers
|
||||||
//var figi1 = "BBG004730N88";
|
//var figi1 = "BBG004730N88";
|
||||||
var figi2 = "BBG004730N88";
|
var figi2 = "BBG004730N88";
|
||||||
//var figi2 = "FUTIMOEXF000";
|
//var figi2 = "FUTIMOEXF000";
|
||||||
var time1 = startDate?? DateTime.UtcNow.AddDays(-17);
|
var time1 = startDate ?? DateTime.UtcNow.AddDays(-17);
|
||||||
//var time1 = new DateTime(2025, 9, 4, 14, 0, 0, DateTimeKind.Utc);
|
//var time1 = new DateTime(2025, 9, 4, 14, 0, 0, DateTimeKind.Utc);
|
||||||
//var time2 = DateTime.UtcNow.AddMinutes(18);
|
//var time2 = DateTime.UtcNow.AddMinutes(18);
|
||||||
using var context1 = await _dbContextFactory.CreateDbContextAsync();
|
using var context1 = await _dbContextFactory.CreateDbContextAsync();
|
||||||
|
|
Loading…
Reference in New Issue