[HELP][MQL4] Can i make a EA wait for what happens the next bars ? - page 2

 
fiehejulien:

Thank you very much !!! its working just fine !

Sure.... no problem... good luck
 
Mike Tanton:
Sure.... no problem... good luck

But i just noticed. That it leaves out a lot of trades. For not obvious reason.



I just attach everything. im just lost. i have no idea what the reason could be.


https://ibb.co/gmQjhry

EURCADH1
EURCADH1
  • ibb.co
Bild EURCADH1 gespeichert in imgbb.com
 

You need to work it out Julien....

It could be that that your ATR value was/is too low... so your "StopLoss" or "TakeProfit" values stopped your EA from Opening Orders... Your "Basic" Entry conditions are now correct... so you need to find out what the problem is...

Do basic "Error" checking... don't just say:

Print("Buy order succeeded!");

You need to "Print" Errors to your "Logs"... not successful code... for eg.

//Execution.....................
      Print("Rhythm Long Position Opened");
      Ticket=OrderSend(Symbol(),OP_BUY,LotSizeRhythm,Ask,Slippage,NULL,NULL,"Rhythm Long Position Opened",
             MagicNumberRhythmLong,0,BuyColor);
      
      if( Ticket > 0 )
         {
         Print("Order placed # ", Ticket);
         }
      else
         {
         Print("Order Send failed, error # ", GetLastError() );
         }

...I'm only interested in the ...

Print("Order Send failed, error # ", GetLastError() );

Jim Dandy hit the nail on the head in Roberto's thread... https://www.mql5.com/en/forum/300696


5943
James Hodges 2019.01.26 00:34      EN

My recommendation would be to look to see if there are any errors in the expert log. If not then I would put some print lines in my code at various places.. is the breakeven function running when it should? put a print line to find out.. if it is running put some error checking code on the ordermodify result.

Are you sure you only want the breakeven opportunity to be checked once on each new candle or would you like it to run on each tick? It may move into an area that warrants moving to breakeven AFTER the candle has been building a while.. only to retreat by candle close and stopping you out. Just something to think about..

Pip Pip.. Jimdandy

Problem with breakeven fuction
Problem with breakeven fuction
  • 2019.01.23
  • www.mql5.com
Hello everyone, I have a problem with a function I already used in another code and it was working...
Reason: