VARS: HH(0), LL(9999), PDHIGH(0), PDLOW(0), PDCLOSE(0), PIV(0);
{Initialize values at beginning of day}
If Date <> Date[1] then begin
HH = H;
LL = L;
End;
{Increment values}
If H > HH then HH = H;
If L < LL then LL = L;
If TIME = SESS1ENDTIME then begin
PDHIGH = HH;
PDLOW = LL;
PDCLOSE = CLOSE;
END;
{Set Pivot value, excluding first day on chart}
If PDCLOSE > 0 then PIV = (PDHIGH + PDLOW + PDCLOSE)/3;
{Buy and sell stops, exclude purchase on first bar at previous day's pivot}
If Time <> SESS1ENDTIME and PDCLOSE > 0 then begin
BUY ("piv.le") NEXT BAR AT PIV STOP;
SELL SHORT ("piv.se") NEXT BAR AT PIV STOP;
End;
****************************************************
That'll give you buy and sell stops every bar at the Pivot, which might actually be practical for trading purposes in some circumstances (you could turn it off and on if the signals were bothering you, for instance - or just let them collect, depending on other settings) - but will make for a tottaly whippy display in most cases (i.e., lots of buys and sells on the same bars).
What kind of conditions you'd want to attach would enable you to refine the signal - such as
If C > PIV then BUY NEXT BAR AT MARKET;
or
Input: MinMove(.005);
Var: MinMove(0), BBUY(0);
BBUY = H + (MinMove * H);
If C > PIV + (MinMove * PIV) then BUYCOND = TRUE else BUYCOND = FALSE;
IF BUYCOND = TRUE then BUY NEXT BAR AT BBUY STOP;
or
If C crosses over PIV then buy next bar at BBUY STOP
etc.
If you want to look at your PIV then you can use an indicator:
VARS: HH(0), LL(9999), PDHIGH(0), PDLOW(0), PDCLOSE(0), PIV(0);
{Initialize values at beginning of day}
If Date <> Date[1] then begin
HH = H;
LL = L;
End;
{Increment values}
If H > HH then HH = H;
If L < LL then LL = L;
If TIME = SESS1ENDTIME then begin
PDHIGH = HH;
PDLOW = LL;
PDCLOSE = CLOSE;
END;
{Set Pivot value, excluding first day on chart}
If PDCLOSE > 0 then begin
PIV = (PDHIGH + PDLOW + PDCLOSE)/3;
Plot1( PIV, "Pivot" ) ;
End;
If H crosses over PIV then ALERT ("Woah, Nelly, it's a buy!");
If L crosses under PIV then ALERT ("Sell this POS");
{SET SCALING "Same as Symbol"; Data in "Subgraph One"}
****
These are just off the top of my head - I'm sure there are more elegant ways to do them.
You might also want to double check 'em for mistakes and incompetence.