Forex Zone - Forex Forum

Adding Delay to your EA

Discussion started on MT4 / MT5 EAs

  • Newbie
  • Posts: 32
  • Points: 0
  • Likes Received: 4
  • Reputation: +2/-0
Here (attached) is a picture and I was wondering what I might learn from you about this. As can be seen, this difference in visual and EA signals is greater than the so called 2 bar delay rule (where because the zero bar data might change the EA may not or does not execute the visual signal until the next bar after the zero bar). So is this (the gap in the screenshot) normal? What can a coder do to "correct" this situation. Because clearly even with a very good strategy such entry misnomers would destroy capital faster than human trading. And can we say computer programs are faster more accurate than humans with this sort of gap in entry? BTW I see this in tools other than that in picture and also EABuilder code (which is supposed to be error free) generates exactly such entries causing losses. Thanks in advance.

The Magician (-_-)

PS: The EA code in this case is supposed to match EA entry signal with visual signal exactly.
I don't think I can answer your questions properly because I did not code this EA or have it's code. The big delay in this case can be an illusion simply because you can be looking at indicators that have repainted. It would be best to look at the indicators at the time of the order instead of showing a chart that has had a lot of time pass by already. So maybe the EA is working correctly and there is no large delay more than 2 candles. You can see whether or not your indicators repaint simply by back testing them. Record the values and colors and then let a few candles form. And so on. Then go back and check all the values and colors at those exact times. If they have changed, then your indicator repaints. You can also test them live on the 1 minute chart and see the same thing.
Right thanks so much for your time. Much appreciated. My take away though is that for indicators not repainting they should normally not show so much lag (e.g. about that two bar limit should be the case). So where we see lags such as I did show then we check for repaint and may be indicator misalignment in settings (in this case two indicators combine to to trigger the EA at a point and I suspect I may not have gotten their alignments right - since I am fairly confident none of the indicators involved repaint). In any case using the visual tester and running on open price only for speed (not testing the EA since not worried for profits just functionality) I am able to adjust settings and have noted huge improvements - the screenshot was for M1 live (demo) run. Thanks though.

The Magician (-_-) 
#16 - July 23, 2018, 01:24:57 PM

Administrator
  • Hero Member
  • Posts: 5114
  • Points: 29361
  • Likes Received: 5122
  • Reputation: +220/-14
Right thanks so much for your time. Much appreciated. My take away though is that for indicators not repainting they should normally not show so much lag (e.g. about that two bar limit should be the case). So where we see lags such as I did show then we check for repaint and may be indicator misalignment in settings (in this case two indicators combine to to trigger the EA at a point and I suspect I may not have gotten their alignments right - since I am fairly confident none of the indicators involved repaint). In any case using the visual tester and running on open price only for speed (not testing the EA since not worried for profits just functionality) I am able to adjust settings and have noted huge improvements - the screenshot was for M1 live (demo) run. Thanks though.

The Magician (-_-)
Indicators can repaint in different ways. Some repaint a little and some repaint drastically. There is no set "lag" that indicators can or cannot repaint by. Yes, if you are already certain that they do not repaint, then it is most likely a mismatch in settings. In other words, your EA is importing indicator values using certain settings, but you are visually looking at the chart that has indicators running with different settings. 
#17 - July 23, 2018, 01:33:30 PM

Adding Delay to your EA in MT4 / MT5 EAs_topic=585

Members:

0 Members and 1 Guest are viewing this topic.