Maximum Trades per Bar

 

Hi Good people

Please can someone help me with the attached EA. For months now I have been trying to sort this.

Am trying to get it to place 5 trades(orders) per bar.

Currently it places multiple orders using an independant grid indicator (attached)

THe grid lines can not be widened further since the objective is to capture  entries as a new candle opens.

Hope I have given enough details to paint the idea.

Thanks

<< TAMA_PS91_3SYSTEMMARKET_2016ABO_YR2015TODATEROUND625_H1_V18__1.mq4 has been removed by a moderator because it is decompiled code. Please do not post decompiled code on the forums >>

 
  1. Ask the owner of the source code to give it to you or have him fix it for you.

    Decompiled code is stolen code. Either you are a thief, a fence, or the receiver of stolen (intellectual) property. Either way we will not be an accomplice after the fact to theft. See also https://www.mql5.com/en/forum/134317#comment_3411571

    If you post decompiled code again, you will likely be banned.

    Don't tell us you found it on the 'net: if someone stole your bank details and uploaded them on to the internet, is it OK for everyone to use them because "someone uploaded it, I don't know why I can't use that"?


  2. Why did you post in the Root / MT5 General section instead of the MQL4 section (bottom of the Root page?)
  3.    for (int i=0; i < OrdersTotal(); i++) 
          {
             bOrderSelect = OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
             if (OrderSymbol() != Symbol()) continue;
          
             if (OrderType() == OP_BUY){
                if ( (dStoploss == 0.0 || dTakeProfit == 0.0) && iTp != 0 && iSl != 0) 
                   bOrderModify = OrderModify(OrderTicket(), OrderOpenPrice(), NormalizeDouble(Ask - Point * (double)iSl, Digits), NormalizeDouble(Ask + Point * (double)iTp, Digits), 0);
    
    Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
  4. Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong
  5.       if (Digits==3 || Digits==5) 
             { iTp=TargetProfit*1; iSl=StopLoss*1; iSp=Slippage*1;iMot=MaxOrdersPerTrendline*1; iPd=PriceDelta*0; iTs=TrailingStopPoint*1; iDigiExtend=1; iPsp=PositionStepPoint*1; }
          else 
             { iTp=TargetProfit; iSl=StopLoss; iSp=Slippage; iPd=PriceDelta; iTs=TrailingStopPoint; iDigiExtend=1; iPsp=PositionStepPoint; iMot=MaxOrdersPerTrendline;}
    
    Your stop is given in points, your code breaks on a 4 digit broker. You are not adjusting SL, TP, and slippage; for 4/5 digit brokers
Reason: