Difference in indicator values between regular charts and visual backtest when using ICustom

 

Hi guys,


I have written an EA in MQL5 that uses the ICustom function for some backtesting and noticed that there are differences between the indicator when I attach it on the chart and when I run it on visual backtest. I have attached the indicator below. I was wondering if you had any experiences with this issue before where there are differences between the values. 


The chart below is a regular chart with the correct VZO value of 38.94572

Regular Chart


The chart below is the visual backtest chart with an incorrect value of 91.90364

Visual Backtester

What could cause the discrepancy in values since the inputs into the indicator are the same?

Files:
VZO.mq5  14 kb