Custom Indicator: iCustom values do not correspond to values on chart - page 2

 
Sameer Shariff:


Here's results for getting the last bar, which should be shift = 0, to represent the current bar.

I don't understand what's going on. Try dropping the indicator on a chart and do a backtest with some test EA that uses iCustom and you will see that chart and backtest just don't tie up.

BACKTESTER
2017.04.02 22:33:06.713 2017.03.31 23:00:00  Fake Move Scalper EURAUD,H1: iCustom | Shift: 0 main: -0.340000 signal: 0.020000
2017.04.02 22:33:06.713 2017.03.31 23:00:00  CDI EURAUD,H1: Indicator | Shift: 0 ExtMainBuffer: -0.340000 ExtSignalBuffer: 0.020000 FastPeriod: 24 SlowPeriod: 90 Instrument1: EURUSD Instrument2: AUDUSD

CHART
2017.04.02 22:31:37.996 Test EURAUD,H1: iCustom | Shift: 0 main: 0.860000 signal: 0.310000
2017.04.02 22:31:37.995 CDI EURAUD,H1: Indicator | Shift: 0 ExtMainBuffer: 0.860000 ExtSignalBuffer: 0.310000 FastPeriod: 24 SlowPeriod: 90 Instrument1: EURUSD Instrument2: AUDUSD


iCustom works the same if you call it from a script or an EA, and as you can see from your results it is producing correct values in both backtesting and on the charts.

There has to be something wrong with the code you're not showing, or your interpretation of the print statements generated by the code you're not showing.

I'm afraid there isn't much more I can do... iCustom works as you can see.

 
honest_knave:


iCustom works the same if you call it from a script or an EA, and as you can see from your results it is producing correct values in both backtesting and on the charts.

There has to be something wrong with the code you're not showing, or your interpretation of the print statements generated by the code you're not showing.

I'm afraid there isn't much more I can do... iCustom works as you can see.


Thanks alot for your help. Much appreciated. I'll dig deeper. Chart shows me certain points when I should enter a trade, but the EA doesn't enter a trade because it doesn't have the same value as the chart. I'll try and debug further.

Once again, thanks alot!

 
Hi Sameer, I have the same problem with any icustom indicator on MT5 - the values do not match the chart - did you ever have any joy in resolving the problem ?