multiple positions

 

Hi everyone,

I'm trying to prepare an expert which is able to do sell and buy in particular strategy. My program is working properly on Strategy Tester but in real situations I'm getting several positions which are completely the same. My desired timeframe is H4 and it means the expert can't open the position up to the next bar(4 hrs) but I have 4 or 5 buy or sell positions at the same time. Please help me... TNX 

 
v.bahremand:

Hi everyone,

I'm trying to prepare an expert which is able to do sell and buy in particular strategy. My program is working properly on Strategy Tester but in real situations I'm getting several positions which are completely the same. My desired timeframe is H4 and it means the expert can't open the position up to the next bar(4 hrs) but I have 4 or 5 buy or sell positions at the same time. Please help me... TNX 

show the code then 

 
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. We can't see your broken code — we can only guess.

EA takes multiple trade on one candle stick in one direction - Expert Advisors and Automated Trading - MQL5 programming forum

 
Cosmas Moses:

show the code then 

  double ich= iIchimoku(Symbol(),PERIOD_CURRENT,9,26,52,MODE_KIJUNSEN,1);
   bool close_flag_0;
       if(  (ich <=  high1 )   &&   (ich >=  low1  ))   // connection between average line and a candle
      {
       if(iClose(Symbol(),PERIOD_CURRENT,1) > ich)
           {
            int buy =  OrderSend(Symbol(),OP_BUY,lot,Ask,5,0,Ask+(Takeprofit*Point),"STRATEGY 1",4428,0,clrGreen);
           }
          
            //----------
       
     else  if(iClose(Symbol(),PERIOD_CURRENT,1) < ich)
          {
            int sell = OrderSend(Symbol(),OP_SELL,lot,Bid,5,Bid-(Stoploss*Point),0,"STRATEGY 1",4429,0,clrRed);
              }
     //