Exemplo n.º 1
0
//+------------------------------------------------------------------+
//| 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();
//---
  }
Exemplo n.º 2
0
//+------------------------------------------------------------------+
//| 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();
    }
//----
}