Strategy Tester Gets Stuck - page 3

 
Viffer:

Jay,


iCustom is your best bet for getting data from an indicator into an EA

https://docs.mql4.com/indicators/iCustom

Just need to put the correct number in mode for the respective buffer. You would call icusotm three times each with a different number in for mode (0/1/2) to get the value of the three buffers.

Hope that helps

V


Hey V,

I read it thrice, i understand how to use and get the indicator values using the double variables and index numbers of the indicator, but how to write in the ea that buy when it is green and sell when it red?


Thanks,

J.

 

What is being returned to icustom? presumably it's variables that the indicator is then displaying as green for rising and red falling?

If so, get the data for the current bar, then again for the prev bar with shift and then compare the two answers to get direction.

Any help?

V

 
Viffer:

What is being returned to icustom? presumably it's variables that the indicator is then displaying as green for rising and red falling?

If so, get the data for the current bar, then again for the prev bar with shift and then compare the two answers to get direction.

Any help?

V


with Shift u get i+1 bars? or i-1 bars?


J.
 
Count forward to go backwards.... Shift 0 is current bar, 1 is prev bar, 2 is two bars ago etc. Some indicators do paint forward in which case count down to go forward. Ichimoko paints the cloud 26 bars into the future so shift would be -26. Easiest way is try it, use print and compare what you get with the indicator
Reason: