InvestorsHub Logo
Post# of 42555
Next 10
Followers 2
Posts 1058
Boards Moderated 1
Alias Born 11/15/2005

Re: CPTMatt post# 5781

Tuesday, 12/26/2006 8:31:50 PM

Tuesday, December 26, 2006 8:31:50 PM

Post# of 42555
The LOC values are what is needed to calculate pivots and they are from 0 GMT (midnight to midnight). Even if I change the local clock the are still gonna be calculated from 0 GMT cause it is HARD CODED in their software right? There is a start time in the ctl file and i played with it for hours. Anybody else have this problem?

Most other pivot point sites calculate from 5pm EST.


Indicator Avail_PPoints;
input
StartHour = 21; /* hour of start of day. I use 2100 (for GMT chart)*/
draw R3("R3"), M5("M5"), R2("R2"), M4("M4"), R1("R1"), M3("M3"), PP("PP"), M2("M2"),
S1("S1"), M1("M1"), S2("S2"), M0("M0"), S3("S3"), line("EMA");
vars i(number), /* index */
lst(number), fst(number), /* index of first and last items in the data set*/
Whigh(number), Wlow(number), /* Working H&L */
Lhigh(number), Llow(number), Lclose(number), /* Last HLC used for calc PP */
i1ststart(number), /*index of start of first whole day*/
i2ndstart(number), /*index of start of second whole day*/
daycount(number), /* used to find first 2 days */
L_PP(number), /*last calculated PP, only changes at start of new day */
L_R3(number), L_M5(number), L_R2(number), L_M4(number), L_R1(number), L_M3(number), L_M2(number),
L_S1(number), L_M1(number), L_S2(number), L_M0(number), L_S3(number);
begin

/* init Variables*/

lst := back(close);
fst := front(close);
daycount := 0;

if lst < fst then
return; /* exit on erroneous data */

/* Scan array, find 1st and 2nd days. Ignore first partial day*/
for i:= fst to lst do begin
if hour(timestamp) = starthour and minute(timestamp) = 0 then begin /* look for start of day based on input starting hour */
daycount := daycount + 1; /* start counting at begin of first day */
if daycount = 1 then begin /* do only at begin of first day after we have skipped partial day's data */
i1ststart := i; /*found index of first day */
Whigh := high; /*Change working HL to current HL at start of first day */
Wlow := low;
end;
if daycount = 2 then i2ndstart := i; /*found index of start of second day */
end;
if daycount = 1 then begin /* find HL of first whole day */
if high > Whigh then Whigh := high;
if low < Wlow then Wlow := low;
end;
end;
if daycount < 2 then return; /* if not at least 2 days of data started then exit */

/*Main routine*/
for i := i2ndstart to lst do begin /*starts plotting only at start of second whole day */
if hour(timestamp) = starthour and minute(timestamp) = 0 then begin
Lhigh := Whigh; /* if we are at the begin of a new day then change HLC and recalculate Pivots */
Llow := Wlow;
Lclose := close[i-1];
Whigh := high; /*Change working HL to current HL at start of day */
Wlow := low;
L_PP := (Lhigh + Llow + Lclose)/3; /* Calculate PP based on yesterday's HLC*/
L_R1 := (2 * L_PP)- Llow;
L_S1 := (2 * L_PP)- Lhigh;
L_R2 := L_PP - L_S1 + L_R1;
L_S2 := L_PP + L_S1 - L_R1;
L_R3 := 2*L_PP + (Lhigh - 2*Llow);
L_S3 := 2*L_PP - (2*Lhigh - Llow);
L_M0 := (L_S2 + L_S3) / 2;
L_M1 := (L_S1 + L_S2) / 2;
L_M2 := (L_S1 + L_PP) / 2;
L_M3 := (L_R1 + L_PP) / 2;
L_M4 := (L_R1 + L_R2) / 2;
L_M5 := (L_R2 + L_R3) / 2;
end;

PP := L_PP;
R1 := L_R1;
R2 := L_R2;
R3 := L_R3;
S1 := L_S1;
S2 := L_S2;
S3 := L_S3;
M0 := L_M0;
M1 := L_M1;
M2 := L_M2;
M3 := L_M3;
M4 := L_M4;
M5 := L_M5;
if high > Whigh then Whigh := high; /* check for HL on current day, used for tomorrow's Pivot calculations */
if low < Wlow then Wlow := low;
end;

end.


Join InvestorsHub

Join the InvestorsHub Community

Register for free to join our community of investors and share your ideas. You will also get access to streaming quotes, interactive charts, trades, portfolio, live options flow and more tools.