Martingale ea: Open 1 order every 15 minutes

 

Hello everyone, I am new, I would like your help with a problem: I am practicing writing a Martingale EA, I want orders to be opened by time instead of points/pips. For example, every 15 minutes an order will be opened, with a maximum of 3 orders. Please help me. Thank you. (The code below is excerpted from MultiCurrency Template EA)

double PipSteps = 0;
   PipSteps = StepPips * point;

   double buyLot = 0, selLot = 0;

   buyLot = lotAdjust(sym,BuyPriceMinLot * MathPow(nextLot,b));
   selLot = lotAdjust(sym,SelPriceMaxLot * MathPow(nextLot,s));

   if(b > 0)
     {
      if(BuyPriceMin - ask >= PipSteps)
        {
         if(CheckMoneyForTrade(sym,buyLot,ORDER_TYPE_BUY) && CheckVolumeValue(sym,buyLot))
           {
            trade.Buy(buyLot,sym,ask,0,0,Commentary);
           }
        }
     }
   if(s > 0)
     {
      if(bid - SelPriceMax >= PipSteps)
        {
         if(CheckMoneyForTrade(sym,selLot,ORDER_TYPE_SELL) && CheckVolumeValue(sym,selLot))
           {
            trade.Sell(selLot,sym,bid,0,0,Commentary);
           }
        }
     }
 
Mark Tony: Hello everyone, I am new, I would like your help with a problem: I am practicing writing a Martingale EA, I want orders to be opened by time instead of points/pips. For example, every 15 minutes an order will be opened, with a maximum of 3 orders. Please help me. Thank you. (The code below is excerpted from MultiCurrency Template EA)

The code you wrote is not part of the function, nor does it appear to be a script for opening orders.

All you need to open orders within a certain period are instructions for opening orders that you place in the OnTimer event area.

 
Nino Guevara Ruwano #:

The code you wrote is not part of the function, nor does it appear to be a script for opening orders.

All you need to open orders within a certain period are instructions for opening orders that you place in the OnTimer event area.

Thank you !