diff --git a/OrdersEA_Smart_Grid.mq5 b/OrdersEA_Smart_Grid.mq5 index 5672e24..fd8e275 100644 --- a/OrdersEA_Smart_Grid.mq5 +++ b/OrdersEA_Smart_Grid.mq5 @@ -132,6 +132,9 @@ datetime lastEquityReset = 0; bool weekendCloseExecuted = false; datetime lastWeekendCheck = 0; +//--- Grid State +static bool gridPlaced = false; + //+------------------------------------------------------------------+ //| Check Daily Drawdown Protection | //+------------------------------------------------------------------+ @@ -657,10 +660,9 @@ bool IsBreakout() //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() - { - static datetime lastBarTime = 0; - static bool gridPlaced = false; - datetime currentBarTime = iTime(_Symbol, PERIOD_CURRENT, 0); + { + static datetime lastBarTime = 0; + datetime currentBarTime = iTime(_Symbol, PERIOD_CURRENT, 0); MqlDateTime dt; TimeToStruct(TimeCurrent(), dt);