mirror of
https://github.com/rithsila/MT5-EA-Sniper-Strategy.git
synced 2026-08-24 08:08:22 +00:00
Gervis DCA
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user