//+------------------------------------------------------------------+ //| OnTick function | //+------------------------------------------------------------------+ void OnTick() { //--- check for history and trading if(Bars<100 || IsTradeAllowed()==false) return; //--- calculate open orders by current symbol if(CalculateCurrentOrders(Symbol())==0) CheckForOpen(); else CheckForClose(); //--- }
//+------------------------------------------------------------------+ //| Start function | //+------------------------------------------------------------------+ void start() { //---- check for history and trading if (Bars < 100 || IsTradeAllowed() == false){ return; } //---- calculate open orders by current symbol if (check_active_order() == FALSE){ CheckForOpen(); } else { CheckForClose(); } //---- }