Page 1 of 1

Code Pivot Points

Posted: 11 Sep 2015 17:08
by Tibovwh
Hi,

I managed to find the following code for PP (built in indicator).

Code: Select all

Express PP
Vars
series xpp, xs1, xs2, xs3, xr1, xr2, xr3;
series ph, pc, pl;
numeric pp, s1, s2, s3, r1, r2, r3;

Calculation
CalculateAtEveryTick(false);
pl = PrevDayLow();
pc = PrevDayClose();
ph = PrevDayHigh();


If IsNewDay() then begin
xs1[1] = void;
xs2[1] = void;
xs3[1] = void;
xr1[1] = void;
xr2[1] = void;
xr3[1] = void;
xpp[1] = void;

pp = (ph + pl + pc)/3;
s1 = ((pp * 2) - ph);
s2 = pp - (ph - pl);
s3 = pl - (2 * (ph - pp));
r1 = ((pp * 2) - pl);
r2 = (pp + (ph - pl));
r3 = ph + 2 * (pp - pl);
end

xpp = pp;
xs1 = s1;
xs2 = s2;
xs3 = s3;
xr1 = r1;
xr2 = r2;
xr3 = r3;


interpretation
begin
end

plotband(xr1, "black", 1, xpp, "black", 2, "green");
plotband(xr2, "black", 1, xr1, "black", 1, "lightgreen");
plotband(xpp, "black", 2, xs1, "black", 1, "red");
plotband(xs1, "black", 1, xs2, "black", 1, "lightred");//@@@cs:364069-3486422-248587_cs@@@

Unfortunatly, this is not entirely the same as the one in the platform. I would love to find how the future bars are plotted on the right side of the chart to implement in something else I'm working on. Is this possible?

Sincerily,

Re: Code Pivot Points

Posted: 11 Sep 2015 20:39
by WHS Support
Hi Tibovwh,

in the NanoTrader it is unfortunately not possible to draw further to the right than the current bar. So you cannot plot into the future.

Kind regards,
Timo
WH SELFINVEST

Re: Code Pivot Points

Posted: 11 Sep 2015 23:08
by Tibovwh
Timo,

Thank you for your answer. I was afraid this was going to be the case. The indicator Pivot Points built in Nanotrader gave me the idea it might have been possible.

Have a good weekend,