Ok so I have an indicator plotted on my chart. I have the very same indicator code inserted as part of my strategy. However to my dismay I discovered that the values between the indicator and the strategy are slightly off. It seems that the indicator is calculated differently compared to when the exact same code is part of a strategy.
What could be causing this and is there a solution?
Here is the indicator code:
Can you help answer these questions from other members on futures io?
Make sure the lookback length (MaxBarsBack) is set to the same. Strategy default is 50, you can change it. Indicators have "auto detect" as default, you can change it.
Make both the same value.
The following user says Thank You to kevinkdog for this post:
Make sure the lookback length (MaxBarsBack) is set to the same. Strategy default is 50, you can change it. Indicators have "auto detect" as default, you can change it.
Make both the same value.
I tried that. Unfortunately it didn't help.
I'm using two different symbols in the strategy. I did some testing and it seems to me that the problem arises when I update the code of the indicator in the strategy to reference "Data2".
In theory there shouldn't be any discrepancy because when comparing the strategy with the indicator code, with the indicator one a single data stream, everything works fine.
So I suspect there is something wrong with my code when I try and use Data2 on the indicator.