Need help with iCustom function.

 
Hello, please help me solve this issue with mt5 tester and EA. I wanted to test RecursiveMA indicator, so I created EA to implement one specific method of backtesting for indicators, but there are some issues with pulled indicator values, they are different from what indicator is showing and ea is pulling. Even when using strategy tester with visualization it gives different recursive ma lines on the visualized screen and different on tester result of the same testing process, I mean when visually testing it was giving completely different curve from what it gave as a result. You can compare screenshots provided below. I guess it is somehow related how it calculates values on real-time data and when running tester but not sure where to look, I even tried #property tester_everytick_calculate and #property tester_no_cache options inside the indicator and there were no result
Files:
 
Are you using the same input setting in both?
 
Documentation on MQL5: Timeseries and Indicators Access / IndicatorCreate
Documentation on MQL5: Timeseries and Indicators Access / IndicatorCreate
  • www.mql5.com
IndicatorCreate - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Yashar Seyyedin #:
Are you using the same input setting in both?

Strange thing is both of the screenshots from the same test run. One of them is visualization during the testing and the second one pops up after test is finished. That's why I was expecting to both of them to be exactly the same but no... I think it somehow related to how the calculation is done inside the RecursiveMA indicator itself, it behaves differently during tester. Even when debugging it is behaving as it should.

 
Gerard Willia G J B M Dinh Sy #:

Hello. If icustom really gives you problems try with indicatorcreate

IndicatorCreate - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5

Thank you for advice, I will look at it and try to implement. Are iCustom and indicatorCreate functions handle indicators differently?

 
Hello. I don't really understand the question but both work with handles
Reason: