I am creating a strategy that looks at the 8, 20 and 50 EMAs in code...and then does something.
I have also added the 8 20 and 50 EMAs to my chart as standard indicators.
The problem I am having is during back-testing using the StrategyAnalzer. When I run the back-test and step into my code (VisualStudio) - I see values for the EMAs that are different to those that I see on the standard indicators.
I have checked the standard indicators and they are all set up correctly and also check via TradingView - so I know those values are correct. It`s just that in my strategy in ninjascript - I see completely different values.
Code used in script :
EightEMA = EMA(Close, 8)[0];
TwentyEMA = EMA(Close, 20)[0];
FiftyEMA = EMA(Close, 50)[0];
For example GBPUSD (Kinetic data source) for 13/12/2019 shows 8 EMA = 1.31651 (which is correct). However in code I see a different value.
Any help would be appreciated.
Thanks
Comment