Чуть доработал логирование решений
test / deploy_trader_prod (push) Successful in 4m58s
Details
test / deploy_trader_prod (push) Successful in 4m58s
Details
parent
7cc13d9ba0
commit
83038954d9
|
@ -6,7 +6,9 @@
|
|||
StopBuy = 1,
|
||||
StopBuyShortTime = 2,
|
||||
OpenLong = 100,
|
||||
OpenLongReal = 101,
|
||||
CloseLong = 200,
|
||||
CloseLongReal = 201,
|
||||
OpenShort = 300,
|
||||
CloseShort = 400,
|
||||
}
|
||||
|
|
|
@ -187,6 +187,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
|||
var accounts = _tradeDataProvider.Accounts
|
||||
.Where(a => !a.Value.Assets.ContainsKey(message.Figi))
|
||||
.ToArray();
|
||||
var loggedDeclisions = 0;
|
||||
foreach (var acc in accounts)
|
||||
{
|
||||
if (IsBuyAllowed(acc.Value, message.Value, 1, _accountCashPartFutures, _accountCashPart))
|
||||
|
@ -201,16 +202,16 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
|||
Count = 1,
|
||||
RecomendPrice = null,
|
||||
});
|
||||
if (loggedDeclisions == 0)
|
||||
{
|
||||
await LogDeclision(DeclisionTradeAction.OpenLongReal, message);
|
||||
loggedDeclisions++;
|
||||
}
|
||||
}
|
||||
|
||||
await LogDeclision(DeclisionTradeAction.OpenLong, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await LogDeclision(DeclisionTradeAction.OpenLong, message);
|
||||
}
|
||||
await LogDeclision(DeclisionTradeAction.OpenLong, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -218,6 +219,7 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
|||
if ((res & TradingEvent.UptrendEnd) == TradingEvent.UptrendEnd)
|
||||
{
|
||||
var assetType = _tradeDataProvider.GetAssetTypeByFigi(message.Figi);
|
||||
var loggedDeclisions = 0;
|
||||
if (!message.IsHistoricalData && BotModeSwitcher.CanSell())
|
||||
{
|
||||
var assetsForClose = _tradeDataProvider.Accounts
|
||||
|
@ -248,14 +250,15 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
|||
Count = (long)asset.Count,
|
||||
RecomendPrice = null,
|
||||
});
|
||||
await LogDeclision(DeclisionTradeAction.CloseLong, message, profit);
|
||||
if (loggedDeclisions == 0)
|
||||
{
|
||||
loggedDeclisions++;
|
||||
await LogDeclision(DeclisionTradeAction.CloseLongReal, message, profit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await LogDeclision(DeclisionTradeAction.CloseLong, message);
|
||||
}
|
||||
await LogDeclision(DeclisionTradeAction.CloseLong, message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace KLHZ.Trader.Service.Controllers
|
|||
{
|
||||
try
|
||||
{
|
||||
var time = DateTime.UtcNow.AddDays(-40);
|
||||
var time = DateTime.UtcNow.AddMinutes(-40);
|
||||
using var context1 = await _dbContextFactory.CreateDbContextAsync();
|
||||
context1.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
|
||||
var data = await context1.PriceChanges
|
||||
|
|
Loading…
Reference in New Issue