Gervis DCA

This commit is contained in:
Nkondog Anselme
2022-01-01 15:32:05 +01:00
parent 0717013a21
commit 2bb0816712
27 changed files with 1777 additions and 2 deletions
+3 -1
View File
@@ -38,7 +38,9 @@ bool ScanPositions()
if(PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_SELL)
gTotalOpenSell++;
//Increment the total orders count
gTotalOpenOrders++;
gTotalOpenPositions++;
gPositionOpenPrice = PositionGetDouble(POSITION_PRICE_OPEN);
//Find what is the open time of the most recent trade and assign it to LastBarTraded
//this is necessary to check if we already traded in the current candle
if((datetime)PositionGetInteger(POSITION_TIME)>gLastBarTraded || gLastBarTraded==NULL)
+4 -1
View File
@@ -31,15 +31,18 @@ void CheckOperationHours()
gIsOperatingHours=true;
return;
}
if(dt.hour > InpTradingHourStart)
if(dt.hour > InpTradingHourStart && dt.hour < InpTradingHourEnd)
{
gIsOperatingHours=true;
}
}
if(InpTradingHourStart>InpTradingHourEnd && ((dt.hour>=InpTradingHourStart && dt.hour<=23) || (dt.hour<=InpTradingHourEnd && dt.hour>=0)))
{
gIsOperatingHours=true;
}
}
//+------------------------------------------------------------------+