OK, this is for Daily & Weekly Pivots, Midpoints and Camarillas, all selectable as required (note, at the end of this code there is information about parameters that need to be programmed too):

IF DAYOFWEEK < DAYOFWEEK[1] THEN

weekhigh = prevweekhigh

weeklow = prevweeklow

weekclose = prevweekclose

prevweekhigh = HIGH

prevweeklow = LOW

ENDIF

prevweekhigh = MAX(prevweekhigh, HIGH)

prevweeklow = MIN(prevweeklow, LOW)

prevweekclose = CLOSE

if (wpiv) then

wp = (weekhigh + weeklow + weekclose)/3

wR2 = wP + (weekhigh - weeklow)

wR1 = (2 * wP) - weeklow

wS1 = (2 * wP) - weekhigh

wS2 = wP - (weekhigh - weeklow)

endif

if (w34) then

wR4 = 3 * (wP - weeklow) + weekhigh

wR3 = 2 * (wP - weeklow) + weekhigh

wS3 = weeklow - (2 * (weekhigh - wP))

wS4 = weeklow - (3 * (weekhigh - wP))

endif

if (wmids) then

wM1 = (wS1+wS2)/2

wM2 = (wS1+wP)/2

wM3 = (wP+wR1)/2

wM4 = (wR1 + wR2)/2

endif

REM now the Camarilla

if (wcam) then

wH4 =((weekhigh-weeklow) * (1.1/2)) + weekclose

wH3 =(( weekhigh-weeklow) * (1.1/4)) + weekclose

wL3 = weekclose - (weekhigh-weeklow) * (1.1/4)

wL4 = weekclose - (weekhigh-weeklow) * (1.1/2)

endif

if (wedata) then

if DayOfWeek =1 then

nn = 1

else

nn = 0

endif

endif

REM first the Pivot, and support and resistance

if (dpiv) then

pivot = (dHigh(1+nn) +dLow(1+nn) + dClose(1+nn))/3

R1 = (2*pivot)-dLow(1+nn)

S1 = (2*pivot)-dHigh(1+nn)

Rtwo = (pivot-S1)+R1

S2 = (pivot-R1)+S1

endif

if (dmids) then

M1 = (S1+S2)/2

M3 = (pivot+R1)/2

M2 = (S1+pivot)/2

M4 = (R1 + Rtwo)/2

endif

REM now the Camarilla

if (dcam) then

H4 =((dHigh(1+nn)-dLow(1+nn)) * (1.1/2)) + dClose(1+nn)

H3 =(( dHigh(1+nn)-dLow(1+nn)) * (1.1/4)) + dClose(1+nn)

L3 = dClose(1+nn) - ((dHigh(1+nn)-dLow(1+nn)) * (1.1/4))

L4 = dClose(1+nn) - ((dHigh(1+nn)-dLow(1+nn)) * (1.1/2))

endif

REM now output the results

return pivot Coloured(255,0,255) as "pivot", R1 Coloured(255,0,0) as "R1", M3 as "M3", S1 Coloured(0,255,0) as "S1", M2 as "M2", Rtwo Coloured(255,0,0) as "R2", M4 as "M4", S2 Coloured(0,255,0) as "S2", M1 as "M1", H4 as "CAM H4", H3 as "CAM H3", L3 as "CAM L3", L4 as "CAM L4", wR4 Coloured(255,0,0) as "w R4", wR3 Coloured(255,0,0) as "w R3", wR2 Coloured(255,0,0) as "w R2", wR1 Coloured(255,0,0) as "w R1", wP as "w P", wS1 Coloured(0,0,255) as "w S1", wS2 Coloured(0,0,255) as "w S2", wS3 Coloured(0,0,255) as "w S3", wS4 Coloured(0,0,255) as "w S4", wM1 as "wM1", wM2 as "wM2", wM3 as "wM3", wM4 as "wM4", wH4 Coloured(0,255,0) as "wH4", wH3 Coloured(0,255,0) as "wH3", wL3 Coloured(0,255,0) as "wL3", wL4 Coloured(0,255,0) as "wL4"

Parameters (all parameters are Boolean):

wpiv (Weekly Pivots)

w34 (Weekly S&R 3 and 4)

wmids (Weekly Midpoints)

wcam (Weekly Camarillas)

wedata (Weekend Data Exists?)

dpiv (Daily Pivots)

dmids (Daily Midpoints)

dcam (Daily Camarillas)

The Weekend Data parameter is necessary sometimes if the charting shows a small candle for Sunday - ticking this option ignores that data.

This is the code for Monthly Pivots, to be applied to a Daily, or Weekly, chart:

IF period <> period[1] THEN

myhigh = prevmyhigh

mylow = prevmylow

myclose = prevmyclose

prevmyhigh = HIGH

prevmylow = LOW

ENDIF

prevmyhigh = MAX(prevmyhigh, HIGH)

prevmylow = MIN(prevmylow, LOW)

prevmyclose = CLOSE

// Pw = (Hveillew + Bveillew + Cveillew) / 3

pw = (myhigh + mylow + myclose)/3

// R1w = 2 * P - Bveillew

myResistance=2*pw-mylow

// S1w = 2 * P - Hveillew

mySupport=2*pw-myhigh

// R2w = P + (Hveillew - Bveillew)

myResistance2=pw+(myhigh - mylow)

// S2w = P - (Hveillew - Bveillew)

mySupport2=pw-(myhigh - mylow)

RETURN pw coloured(0,0,255) AS "Pivot" , myResistance coloured(0,255,0) AS "R1" , mySupport coloured(0,255,0) AS "S1" , myResistance2 coloured(255,0,0) AS "R2" , mySupport2 coloured(255,0,0) AS "S2"

Anyone not sure how to code this in, shout and I'll post a guide.

Good luck trading, Pete.