Hi,
I have created 2 MAs, 1 EMA and 1 MVA, in a strategy and I signal when price crosses the faster MA. Whenever I check the values of each MA after the crossover, the value given to me by the strategy is different from what I see on the chart. Is there a way to make them exactly the same? I created the chart indicator to match the ones in the strategy.
Code snippets:
MA = core.indicators:create("EMA", Source.close, instance.parameters.Fast);
SLOW = core.indicators:create("MVA", Source.close, instance.parameters.Slow);
MA:update(core.UpdateLast);
SLOW:update(core.UpdateLast);
if MA.DATA[period] > SLOW.DATA[period]
then
Alert("10 MA > 200 MA FAST: ", MA.DATA[period] , period);
Alert("10 MA > 200 MA SLOW: ", SLOW.DATA[period] , period);
end
Thanks in advance.