Hi, I'm trying to find a way to calculate the yearly pivot from the
first trading day of the year. I've been using the following code but
it doesn't display from the start of the year so I don't think I'm
using it correctly:

YearHigh = TimeFrameGetPrice("H",inMonthly*12,-1);
YearLow = TimeFrameGetPrice("L",inMonthly*12,-1);
YearClose = TimeFrameGetPrice("C",inMonthly*12,-1);
YearlyPP = (YearHigh + YearLow + YearClose)/3;

Plot(YearlyPP, "PP",colorRed, styleStaircase+styleNoRescale+styleLine);

Does anyone know how I can get it to start from the beginning of the year?

Another way I've tried is finding the previous year's high by using
YearHigh = LastValue(Highest((Year()==2006)*H)), which seems to work
correctly, but when trying to find the yearly low using YearLow =
LastValue(Lowest((Year()==2006)*L)), YearLow always returns as 0.

Am I using this code incorrectly or does anyone know of another way to
find the high, low and close of the previous year?

Thanks for your help,
Swanny.


Reply via email to