очистка кода
test / deploy_trader_prod (push) Successful in 1m55s
Details
test / deploy_trader_prod (push) Successful in 1m55s
Details
parent
6884407f12
commit
d045f9b082
|
@ -25,7 +25,7 @@
|
||||||
if (k1 != k2)
|
if (k1 != k2)
|
||||||
{
|
{
|
||||||
var cross = LinesCrossing(k1, b1, k2, b2);
|
var cross = LinesCrossing(k1, b1, k2, b2);
|
||||||
if (cross.x>=0 && cross.x <= dtime)
|
if (cross.x >= 0 && cross.x <= dtime)
|
||||||
{
|
{
|
||||||
var crossingTimestamp = time1.AddSeconds((double)cross.x);
|
var crossingTimestamp = time1.AddSeconds((double)cross.x);
|
||||||
return crossingTimestamp >= time1 && crossingTimestamp <= time2;
|
return crossingTimestamp >= time1 && crossingTimestamp <= time2;
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace KLHZ.Trader.Core.Math.Declisions.Utils
|
||||||
return (startTime, sum / count);
|
return (startTime, sum / count);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TradingEvent CheckByWindowAverageMean(DateTime[] timestamps, decimal[] prices, int size,int smallWindow, int bigWindow, decimal meanfullStep = 3m)
|
public static TradingEvent CheckByWindowAverageMean(DateTime[] timestamps, decimal[] prices, int size, int smallWindow, int bigWindow, decimal meanfullStep = 3m)
|
||||||
{
|
{
|
||||||
var res = TradingEvent.None;
|
var res = TradingEvent.None;
|
||||||
if (timestamps.Length < size)
|
if (timestamps.Length < size)
|
||||||
|
@ -29,8 +29,8 @@ namespace KLHZ.Trader.Core.Math.Declisions.Utils
|
||||||
var twavss = new decimal[size];
|
var twavss = new decimal[size];
|
||||||
var twavbs = new decimal[size];
|
var twavbs = new decimal[size];
|
||||||
var times = new DateTime[size];
|
var times = new DateTime[size];
|
||||||
|
|
||||||
|
|
||||||
for (int shift = 0; shift < size; shift++)
|
for (int shift = 0; shift < size; shift++)
|
||||||
{
|
{
|
||||||
var twavs = CalcTimeWindowAverageValue(timestamps, prices, smallWindow, shift);
|
var twavs = CalcTimeWindowAverageValue(timestamps, prices, smallWindow, shift);
|
||||||
|
|
|
@ -141,10 +141,10 @@ namespace KLHZ.Trader.Core.Exchange.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var result = MovingAverage.CheckByWindowAverageMean(data.timestamps, data.prices, 100,15,120);
|
var result = MovingAverage.CheckByWindowAverageMean(data.timestamps, data.prices, 100, 15, 120);
|
||||||
if ((result & TradingEvent.StopBuy) == TradingEvent.StopBuy)
|
if ((result & TradingEvent.StopBuy) == TradingEvent.StopBuy)
|
||||||
{
|
{
|
||||||
var stopTo = (message.IsHistoricalData?message.Time: DateTime.UtcNow).AddMinutes(_buyStopLength);
|
var stopTo = (message.IsHistoricalData ? message.Time : DateTime.UtcNow).AddMinutes(_buyStopLength);
|
||||||
BuyStops.AddOrUpdate(message.Figi, stopTo, (k, v) => stopTo);
|
BuyStops.AddOrUpdate(message.Figi, stopTo, (k, v) => stopTo);
|
||||||
declisionsForSave.Add(new Declision()
|
declisionsForSave.Add(new Declision()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue