I have a simple custom indicator that I am trying to use within an EA. I currently grab the indicator's values using the infamous iCustom() function. Problem is that the indicator does not generate the same output values when backtesting the EA. It is not an off "by one" error, but the actual result still resembles the expected outcome. It appears to be out of synch! Take a look.
Can someone help me find a way to "synchronize" the indicator's output within the EA backtester? Basically, when I run the strategy tester in Visual Mode, then attach the indicator while running, then stop the test halfway, the indicator outputs SHOULD be the same as if I dragged an indicator on a plain chart.
Screen capture A shows the backtester output.
- It has 2 indicators because one comes from manually dragging the indicator on while the tester is running, the 2nd using iCustom() within the EA code itself.
Screen capture B shows the plain indicator dragged onto a chart output.
Screen capture B is how the indicator SHOULD look. I have been stuck on this problem for 2 weeks and can't stand it anymore. Please help?
Thanks in advance.
-Shuli
Attachments:
1) Screenshot of inconsistent indicator outputs
2) Indicator code
About the indicator: It is a play on pairs trading for FX. The difference in price between the EURUSD and GBPUSD is "normalized" and charted.
3) EA Code (completely commented out everything but the basics of opening and immediately closing a sell order)
Can someone help me find a way to "synchronize" the indicator's output within the EA backtester? Basically, when I run the strategy tester in Visual Mode, then attach the indicator while running, then stop the test halfway, the indicator outputs SHOULD be the same as if I dragged an indicator on a plain chart.
Screen capture A shows the backtester output.
- It has 2 indicators because one comes from manually dragging the indicator on while the tester is running, the 2nd using iCustom() within the EA code itself.
Screen capture B shows the plain indicator dragged onto a chart output.
Screen capture B is how the indicator SHOULD look. I have been stuck on this problem for 2 weeks and can't stand it anymore. Please help?
Thanks in advance.
-Shuli
Attachments:
1) Screenshot of inconsistent indicator outputs
2) Indicator code
About the indicator: It is a play on pairs trading for FX. The difference in price between the EURUSD and GBPUSD is "normalized" and charted.
3) EA Code (completely commented out everything but the basics of opening and immediately closing a sell order)
Attached File(s)
Shuli_PairDiff_Norm.mq4
6 KB
|
378 downloads
Shuli_TEST_EA.mq4
5 KB
|
360 downloads