Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input marketThreshold = 0.00;
- input timeFrame = {default DAY, "2 DAYS", "3 DAYS", "4 DAYS", WEEK, MONTH, YEAR, "OPT EXP"};
- input showOnlyToday = no;
- def PP2 = high(period = timeFrame)[2] + low(period = timeFrame)[2] + close(period = timeFrame)[2];
- plot R3;
- plot R2;
- plot R1;
- plot PP;
- plot S1;
- plot S2;
- plot S3;
- if showOnlyToday and !IsNaN(close(period = timeFrame)[-1])
- then {
- R1 = Double.NaN;
- R2 = Double.NaN;
- R3 = Double.NaN;
- PP = Double.NaN;
- S1 = Double.NaN;
- S2 = Double.NaN;
- S3 = Double.NaN;
- } else {
- PP = (high(period = timeFrame)[1] + low(period = timeFrame)[1] + close(period = timeFrame)[1]) / 3;
- R1 = PP + ((high(period = timeFrame)[1] - low(period = timeFrame)[1])* .382);
- R2 = PP + ((high(period = timeFrame)[1] - low(period = timeFrame)[1])* .618);
- R3 = PP + ((high(period = timeFrame)[1] - low(period = timeFrame)[1])* 1.0);
- S1 = PP - ((high(period = timeFrame)[1] - low(period = timeFrame)[1])* .382);
- S2 = PP - ((high(period = timeFrame)[1] - low(period = timeFrame)[1])* .618);
- S3 = PP - ((high(period = timeFrame)[1] - low(period = timeFrame)[1])* 1.0);
- }
- PP.SetDefaultColor(GetColor(0));
- R1.SetDefaultColor(GetColor(2));
- R2.SetDefaultColor(GetColor(8));
- R3.SetDefaultColor(GetColor(3));
- S1.SetDefaultColor(GetColor(6));
- S2.SetDefaultColor(GetColor(1));
- S3.SetDefaultColor(GetColor(3));
- 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" or timeFrame == timeFrame.YEAR then PaintingStrategy.DASHES else PaintingStrategy.DASHES;
- PP.SetPaintingStrategy(paintingStrategy);
- R1.SetPaintingStrategy(paintingStrategy);
- R2.SetPaintingStrategy(paintingStrategy);
- R3.SetPaintingStrategy(paintingStrategy);
- S1.SetPaintingStrategy(paintingStrategy);
- S2.SetPaintingStrategy(paintingStrategy);
- S3.SetPaintingStrategy(paintingStrategy);
- #####
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement