I've been brushing up on my pivot point skills lately and finding them very helpful for scalping during the day. I have figured out some strategies on my own and also posted a link in the iBox for someone that made a living using them. I posted some other links there I think are useful too for using this trading strategy.
TOS has code for pivot points but, I've never liked it. The code below changes the dots to dashed lines which I think is much easier to view on the charts. Most of the time I select the option to only view the points for the day. However, I do turn them all on during off trading hours to view what they are doing in relation to each other.
Happy trading!
#####################
input marketThreshold = 0.00;
input timeFrame = {default DAY, "2 DAYS", "3 DAYS", "4 DAYS", WEEK, MONTH, "OPT EXP"};
input showOnlyToday = no;
rec marketType = {default DISABLED, NEUTRAL, BEARISH, BULLISH};
def PP2 = high(period = timeFrame)[2] + low(period = timeFrame)[2] + close(period = timeFrame)[2];
marketType =
if PP2[-1] > (PP2[-1] + PP2 + PP2[1]) / 3 + marketThreshold then marketType.BULLISH else
if PP2[-1] < (PP2[-1] + PP2 + PP2[1]) / 3 - marketThreshold then marketType.BEARISH else marketType.NEUTRAL;
plot R4;
plot R3;
plot R2;
plot R1;
plot PP;
plot S1;
plot S2;
plot S3;
plot S4;
if showOnlyToday and !IsNaN(close(period = timeFrame)[-1])
then {
R1 = Double.NaN;
R2 = Double.NaN;
R3 = Double.NaN;
R4 = Double.NaN;
PP = Double.NaN;
S1 = Double.NaN;
S2 = Double.NaN;
S3 = Double.NaN;
S4 = Double.NaN;
} else {
PP = (high(period = timeFrame)[1] + low(period = timeFrame)[1] + close(period = timeFrame)[1]) / 3;
R1 = 2 * PP - low(period = timeFrame)[1];
R2 = PP + high(period = timeFrame)[1] - low(period = timeFrame)[1];
R3 = R2 + high(period = timeFrame)[1] - low(period = timeFrame)[1];
R4 = R3 + high(period = timeFrame)[1] - low(period = timeFrame)[1];
S1 = 2 * PP - high(period = timeFrame)[1];
S2 = PP - high(period = timeFrame)[1] + low(period = timeFrame)[1];
S3 = S2 - high(period = timeFrame)[1] + low(period = timeFrame)[1];
S4 = S3 - high(period = timeFrame)[1] + low(period = timeFrame)[1];
}
PP.SetDefaultColor(GetColor(0));
R1.SetDefaultColor(GetColor(2));
R2.SetDefaultColor(GetColor(8));
R3.SetDefaultColor(GetColor(3));
R4.SetDefaultColor(GetColor(5));
S1.SetDefaultColor(GetColor(2));
S2.SetDefaultColor(GetColor(8));
S3.SetDefaultColor(GetColor(3));
S4.SetDefaultColor(GetColor(5));
PP.SetStyle(Curve.firm);
R1.SetStyle(Curve.SHORT_DASH);
R2.SetStyle(Curve.SHORT_DASH);
R3.SetStyle(Curve.SHORT_DASH);
S1.SetStyle(Curve.SHORT_DASH);
S2.SetStyle(Curve.SHORT_DASH);
S3.SetStyle(Curve.SHORT_DASH);
def paintingStrategy = if timeframe == timeframe.WEEK then PaintingStrategy.DASHES else if timeFrame == timeFrame.MONTH or timeFrame == timeFrame."OPT EXP" then PaintingStrategy.DASHES else PaintingStrategy.DASHES;
PP.SetPaintingStrategy(paintingStrategy);
R1.SetPaintingStrategy(paintingStrategy);
R2.SetPaintingStrategy(paintingStrategy);
R3.SetPaintingStrategy(paintingStrategy);
R4.SetPaintingStrategy(paintingStrategy);
S1.SetPaintingStrategy(paintingStrategy);
S2.SetPaintingStrategy(paintingStrategy);
S3.SetPaintingStrategy(paintingStrategy);
S4.SetPaintingStrategy(paintingStrategy);