by robbieyoung » Thu Feb 08, 2018 12:49 pm
I changed the code to:
local name = profile:id() .. "(" .. instance.source:name() .. ", " .. Period1 .. ", " .. Period2 .. ")";
and:
local Sum1=mathex.sum(source, period-Period1+1, period);
local Sum2=mathex.sum(source, period-Period2+1, period);
Line[period]=source[period]+(Period2*Sum1-Period1*Sum2)/(Period1-Period2);
and this seems to have done shifted the graph back 1 period and also provides a calculation for the final open bar.
I cannot thank you enough for all your work in creating this indicator.
It will be a massive help to me monitoring for potential upcoming trades.