rlohmeyer
Active member
@Kislayakanan@rlohmeyer: Thank you for sharing the level indicator. I have been looking for something like this for a long time. I have couple of questions:
1. What is the significance of yellow line?
2. What is the recommended setting for "Increment" and "Major"
3. What does PD, PU and SMU mean?
Sorry for the delay. Below is the code for for the Price Time Grid indicator. The picture below that shows this indicator on a 1 minute chart of QQQ.,which is at this point the only instrument I day trade.
Code:
#PriceTimeGrid
#@rlohmeyer shared on UseThinkscript
#Thanks to @OBW, @SleepyZ, and @Generic when I got stuck with code
# 3/11/2021
input plotgrid = yes;
input increment = 1.00;
input ShowMidpoint = yes;
def Mid = if plotgrid then increment/2 else double.NaN;
def na = double.NaN;
input major = 5.00;
def c = close;
def o = open;
#Plot Icrements
def start = if plotgrid then Round(open / major, 0) * major else double.NaN;
def str = if !IsNaN(c) and IsNaN(c[-1]) then start else str[1];
plot ST = if IsNaN(c[-780]) then str[-780] else Double.NaN;
ST.SetDefaultColor(CreateColor(255, 4, 204));
ST.HideTitle();
ST.SetPaintingStrategy(PaintingStrategy.horizontal);
ST.SetLineWeight(1);
#Plot Up Lines
plot MU = (if ShowMidpoint == 1 then ST + Mid else na);
MU.AssignValueColor(Color.light_gray);
MU.HideTitle();
MU.SetPaintingStrategy(PaintingStrategy.dashes);
MU.SetLineWeight(1);
MU.Hidebubble();
plot PU1 = ST + INCREMENT;
PU1.AssignValueColor(if (PU1/major)/Round((PU1/major),0) == 1 then (CreateColor(255, 4, 204)) else Color.white);
PU1.HideTitle();
PU1.SetPaintingStrategy(PaintingStrategy.horizontal);
PU1.SetLineWeight(1);
plot MU1 = (if ShowMidpoint == 1 then PU1 + Mid else na);
MU1.AssignValueColor(Color.light_gray);
MU1.HideTitle();
MU1.SetPaintingStrategy(PaintingStrategy.dashes);
MU1.SetLineWeight(1);
MU1.Hidebubble();
plot PU2 = ST + (2 * INCREMENT);
PU2.AssignValueColor(if (PU2/major)/Round((PU2/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU2.HideTitle();
PU2.SetPaintingStrategy(PaintingStrategy.horizontal);
PU2.SetLineWeight(1);
plot MU2 = (if ShowMidpoint == 1 then PU2 + Mid else na);
MU2.AssignValueColor(Color.light_gray);
MU2.HideTitle();
MU2.SetPaintingStrategy(PaintingStrategy.dashes);
MU2.SetLineWeight(1);
MU2.Hidebubble();
plot PU3 = ST + (3 * INCREMENT);
PU3.AssignValueColor(if (PU3/major)/Round((PU3/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU3.HideTitle();
PU3.SetPaintingStrategy(PaintingStrategy.horizontal);
PU3.SetLineWeight(1);
plot MU3 = (if ShowMidpoint == 1 then PU3 + Mid else na);
MU3.AssignValueColor(Color.light_gray);
MU3.HideTitle();
MU3.SetPaintingStrategy(PaintingStrategy.dashes);
MU3.SetLineWeight(1);
MU3.Hidebubble();
plot PU4 = ST + (4 * INCREMENT);
PU4.AssignValueColor(if (PU4/major)/Round((PU4/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU4.HideTitle();
PU4.SetPaintingStrategy(PaintingStrategy.horizontal);
PU4.SetLineWeight(1);
plot MU4 = (if ShowMidpoint == 1 then PU4 + Mid else na);
MU4.AssignValueColor(Color.light_gray);
MU4.HideTitle();
MU4.SetPaintingStrategy(PaintingStrategy.dashes);
MU4.SetLineWeight(1);
MU4.Hidebubble();
plot PU5 = ST + (5 * INCREMENT);
PU5.AssignValueColor(if (PU5/major)/Round((PU5/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU5.HideTitle();
PU5.SetPaintingStrategy(PaintingStrategy.horizontal);
PU5.SetLineWeight(1);
plot MU5 = (if ShowMidpoint == 1 then PU5 + Mid else na);
MU5.AssignValueColor(Color.light_gray);
MU5.HideTitle();
MU5.SetPaintingStrategy(PaintingStrategy.dashes);
MU5.SetLineWeight(1);
MU5.Hidebubble();
plot PU6 = ST + (6 * INCREMENT);
PU6.AssignValueColor(if (PU6/major)/Round((PU6/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU6.HideTitle();
PU6.SetPaintingStrategy(PaintingStrategy.horizontal);
PU6.SetLineWeight(1);
plot MU6 = (if ShowMidpoint == 1 then PU6 + Mid else na);
MU6.AssignValueColor(Color.light_gray);
MU6.HideTitle();
MU6.SetPaintingStrategy(PaintingStrategy.dashes);
MU6.SetLineWeight(1);
MU6.Hidebubble();
plot PU7 = ST + (7 * INCREMENT);
PU7.AssignValueColor(if (PU7/major)/Round((PU7/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU7.HideTitle();
PU7.SetPaintingStrategy(PaintingStrategy.horizontal);
PU7.SetLineWeight(1);
plot MU7 = (if ShowMidpoint == 1 then PU7 + Mid else na);
MU7.AssignValueColor(Color.light_gray);
MU7.HideTitle();
MU7.SetPaintingStrategy(PaintingStrategy.dashes);
MU7.SetLineWeight(1);
MU7.Hidebubble();
plot PU8 = ST + (8 * INCREMENT);
PU8.AssignValueColor(if (PU8/major)/Round((PU8/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU8.HideTitle();
PU8.SetPaintingStrategy(PaintingStrategy.horizontal);
PU8.SetLineWeight(1);
plot MU8 = (if ShowMidpoint == 1 then PU8 + Mid else na);
MU8.AssignValueColor(Color.light_gray);
MU8.HideTitle();
MU8.SetPaintingStrategy(PaintingStrategy.dashes);
MU8.SetLineWeight(1);
MU8.Hidebubble();
plot PU9 = ST + (9 * INCREMENT);
PU9.AssignValueColor(if (PU9/major)/Round((PU9/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU9.HideTitle();
PU9.SetPaintingStrategy(PaintingStrategy.horizontal);
PU9.SetLineWeight(1);
plot MU9 = (if ShowMidpoint == 1 then PU9 + Mid else na);
MU9.AssignValueColor(Color.light_gray);
MU9.HideTitle();
MU9.SetPaintingStrategy(PaintingStrategy.dashes);
MU9.SetLineWeight(1);
MU9.Hidebubble();
plot PU10 = ST + (10 * INCREMENT);
PU10.AssignValueColor(if (PU10/major)/Round((PU10/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU10.HideTitle();
PU10.SetPaintingStrategy(PaintingStrategy.horizontal);
PU10.SetLineWeight(1);
plot MU10 = (if ShowMidpoint == 1 then PU10 + Mid else na);
MU10.AssignValueColor(Color.light_gray);
MU10.HideTitle();
MU10.SetPaintingStrategy(PaintingStrategy.dashes);
MU10.SetLineWeight(1);
MU10.Hidebubble();
plot PU11 = ST + (11 * INCREMENT);
PU11.AssignValueColor(if (PU11/major)/Round((PU11/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU11.HideTitle();
PU11.SetPaintingStrategy(PaintingStrategy.horizontal);
PU11.SetLineWeight(1);
plot MU11 = (if ShowMidpoint == 1 then PU11 + Mid else na);
MU11.AssignValueColor(Color.light_gray);
MU11.HideTitle();
MU11.SetPaintingStrategy(PaintingStrategy.dashes);
MU11.SetLineWeight(1);
MU11.Hidebubble();
plot PU12 = ST + (12 * INCREMENT);
PU12.AssignValueColor(if (PU12/major)/Round((PU12/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU12.HideTitle();
PU12.SetPaintingStrategy(PaintingStrategy.horizontal);
PU12.SetLineWeight(1);
plot MU12 = (if ShowMidpoint == 1 then PU12 + Mid else na);
MU12.AssignValueColor(Color.light_gray);
MU12.HideTitle();
MU12.SetPaintingStrategy(PaintingStrategy.dashes);
MU12.SetLineWeight(1);
MU12.Hidebubble();
plot PU13 = ST + (13 * INCREMENT);
PU13.AssignValueColor(if (PU13/major)/Round((PU13/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU13.HideTitle();
PU13.SetPaintingStrategy(PaintingStrategy.horizontal);
PU13.SetLineWeight(1);
plot MU13 = (if ShowMidpoint == 1 then PU13 + Mid else na);
MU13.AssignValueColor(Color.light_gray);
MU13.HideTitle();
MU13.SetPaintingStrategy(PaintingStrategy.dashes);
MU13.SetLineWeight(1);
MU13.Hidebubble();
plot PU14 = ST + (14 * INCREMENT);
PU14.AssignValueColor(if (PU14/major)/Round((PU14/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU14.HideTitle();
PU14.SetPaintingStrategy(PaintingStrategy.horizontal);
PU14.SetLineWeight(1);
plot MU14 = (if ShowMidpoint == 1 then PU14 + Mid else na);
MU14.AssignValueColor(Color.light_gray);
MU14.HideTitle();
MU14.SetPaintingStrategy(PaintingStrategy.dashes);
MU14.SetLineWeight(1);
MU14.Hidebubble();
plot PU15 = ST + (15 * INCREMENT);
PU15.AssignValueColor(if (PU15/major)/Round((PU15/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU15.HideTitle();
PU15.SetPaintingStrategy(PaintingStrategy.horizontal);
PU15.SetLineWeight(1);
plot MU15 = (if ShowMidpoint == 1 then PU15 + Mid else na);
MU15.AssignValueColor(Color.light_gray);
MU15.HideTitle();
MU15.SetPaintingStrategy(PaintingStrategy.dashes);
MU15.SetLineWeight(1);
MU15.Hidebubble();
plot PU16 = ST + (16 * INCREMENT);
PU16.AssignValueColor(if (PU16/major)/Round((PU16/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU16.HideTitle();
PU16.SetPaintingStrategy(PaintingStrategy.horizontal);
PU16.SetLineWeight(1);
plot MU16 = (if ShowMidpoint == 1 then PU16 + Mid else na);
MU16.AssignValueColor(Color.light_gray);
MU16.HideTitle();
MU16.SetPaintingStrategy(PaintingStrategy.dashes);
MU16.SetLineWeight(1);
MU16.Hidebubble();
plot PU17 = ST + (17 * INCREMENT);
PU17.AssignValueColor(if (PU17/major)/Round((PU17/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU17.HideTitle();
PU17.SetPaintingStrategy(PaintingStrategy.horizontal);
PU17.SetLineWeight(1);
plot MU17 = (if ShowMidpoint == 1 then PU17 + Mid else na);
MU17.AssignValueColor(Color.light_gray);
MU17.HideTitle();
MU17.SetPaintingStrategy(PaintingStrategy.dashes);
MU17.SetLineWeight(1);
MU17.Hidebubble();
plot PU18 = ST + (18 * INCREMENT);
PU18.AssignValueColor(if (PU18/major)/Round((PU18/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU18.HideTitle();
PU18.SetPaintingStrategy(PaintingStrategy.horizontal);
PU18.SetLineWeight(1);
plot MU18 = (if ShowMidpoint == 1 then PU18 + Mid else na);
MU18.AssignValueColor(Color.light_gray);
MU18.HideTitle();
MU18.SetPaintingStrategy(PaintingStrategy.dashes);
MU18.SetLineWeight(1);
MU18.Hidebubble();
plot PU19 = ST + (19 * INCREMENT);
PU19.AssignValueColor(if (PU19/major)/Round((PU19/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU19.HideTitle();
PU19.SetPaintingStrategy(PaintingStrategy.horizontal);
PU19.SetLineWeight(1);
plot MU19 = (if ShowMidpoint == 1 then PU19 + Mid else na);
MU19.AssignValueColor(Color.light_gray);
MU19.HideTitle();
MU19.SetPaintingStrategy(PaintingStrategy.dashes);
MU19.SetLineWeight(1);
MU19.Hidebubble();
plot PU20 = ST + (20 * INCREMENT);
PU20.AssignValueColor(if (PU20/major)/Round((PU20/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PU20.HideTitle();
PU20.SetPaintingStrategy(PaintingStrategy.horizontal);
PU20.SetLineWeight(1);
#Plot Down Lines
plot MD = (if ShowMidpoint == 1 then ST - Mid else na);
MD.AssignValueColor(Color.light_gray);
MD.HideTitle();
MD.SetPaintingStrategy(PaintingStrategy.dashes);
MD.SetLineWeight(1);
MD.Hidebubble();
plot PD1 = ST - INCREMENT ;
PD1.AssignValueColor(if (PD1/major)/Round((PD1/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD1.HideTitle();
PD1.SetPaintingStrategy(PaintingStrategy.horizontal);
PD1.SetLineWeight(1);
plot MD1 = (if ShowMidpoint == 1 then PD1 - Mid else na);
MD1.AssignValueColor(Color.light_gray);
MD1.HideTitle();
MD1.SetPaintingStrategy(PaintingStrategy.dashes);
MD1.SetLineWeight(1);
MD1.Hidebubble();
plot PD2 = ST - (2 * INCREMENT) ;
PD2.AssignValueColor(if (PD2/major)/Round((PD2/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD2.HideTitle();
PD2.SetPaintingStrategy(PaintingStrategy.horizontal);
PD2.SetLineWeight(1);
plot MD2 = (if ShowMidpoint == 1 then PD2 - Mid else na);
MD2.AssignValueColor(Color.light_gray);
MD2.HideTitle();
MD2.SetPaintingStrategy(PaintingStrategy.dashes);
MD2.SetLineWeight(1);
MD2.Hidebubble();
plot PD3 = ST - (3 * INCREMENT);
PD3.AssignValueColor(if (PD3/major)/Round((PD3/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD3.HideTitle();
PD3.SetPaintingStrategy(PaintingStrategy.horizontal);
PD3.SetLineWeight(1);
plot MD3 = (if ShowMidpoint == 1 then PD3 - Mid else na);
MD3.AssignValueColor(Color.light_gray);
MD3.HideTitle();
MD3.SetPaintingStrategy(PaintingStrategy.dashes);
MD3.SetLineWeight(1);
MD3.Hidebubble();
plot PD4 = ST - (4 * INCREMENT);
PD4.AssignValueColor(if (PD4/major)/Round((PD4/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD4.HideTitle();
PD4.SetPaintingStrategy(PaintingStrategy.horizontal);
PD4.SetLineWeight(1);
plot MD4 = (if ShowMidpoint == 1 then PD4 - Mid else na);
MD4.AssignValueColor(Color.light_gray);
MD4.HideTitle();
MD4.SetPaintingStrategy(PaintingStrategy.dashes);
MD4.SetLineWeight(1);
MD4.Hidebubble();
plot PD5 = ST - (5 * INCREMENT);
PD5.AssignValueColor(if (PD5/major)/Round((PD5/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD5.HideTitle();
PD5.SetPaintingStrategy(PaintingStrategy.horizontal);
PD5.SetLineWeight(1);
plot MD5 = (if ShowMidpoint == 1 then PD5 - Mid else na);
MD5.AssignValueColor(Color.light_gray);
MD5.HideTitle();
MD5.SetPaintingStrategy(PaintingStrategy.dashes);
MD5.SetLineWeight(1);
MD5.Hidebubble();
plot PD6 = ST - (6 * INCREMENT);
PD6.AssignValueColor(if (PD6/major)/Round((PD6/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD6.HideTitle();
PD6.SetPaintingStrategy(PaintingStrategy.horizontal);
PD6.SetLineWeight(1);
plot MD6 = (if ShowMidpoint == 1 then PD6 - Mid else na);
MD6.AssignValueColor(Color.light_gray);
MD6.HideTitle();
MD6.SetPaintingStrategy(PaintingStrategy.dashes);
MD6.SetLineWeight(1);
MD6.Hidebubble();
plot PD7 = ST - (7 * INCREMENT);
PD7.AssignValueColor(if (PD7/major)/Round((PD7/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD7.HideTitle();
PD7.SetPaintingStrategy(PaintingStrategy.horizontal);
PD7.SetLineWeight(1);
plot MD7 = (if ShowMidpoint == 1 then PD7 - Mid else na);
MD7.AssignValueColor(Color.light_gray);
MD7.HideTitle();
MD7.SetPaintingStrategy(PaintingStrategy.dashes);
MD7.SetLineWeight(1);
MD7.Hidebubble();
plot PD8 = ST - (8 * INCREMENT);
PD8.AssignValueColor(if (PD8/major)/Round((PD8/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD8.HideTitle();
PD8.SetPaintingStrategy(PaintingStrategy.horizontal);
PD8.SetLineWeight(1);
plot MD8 = (if ShowMidpoint == 1 then PD8 - Mid else na);
MD8.AssignValueColor(Color.light_gray);
MD8.HideTitle();
MD8.SetPaintingStrategy(PaintingStrategy.dashes);
MD8.SetLineWeight(1);
MD8.Hidebubble();
plot PD9 = ST - (9 * INCREMENT);
PD9.AssignValueColor(if (PD9/major)/Round((PD9/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD9.HideTitle();
PD9.SetPaintingStrategy(PaintingStrategy.horizontal);
PD9.SetLineWeight(1);
plot MD9 = (if ShowMidpoint == 1 then PD9 - Mid else na);
MD9.AssignValueColor(Color.light_gray);
MD9.HideTitle();
MD9.SetPaintingStrategy(PaintingStrategy.dashes);
MD9.SetLineWeight(1);
MD9.Hidebubble();
plot PD10 = ST - (10 * INCREMENT);
PD10.AssignValueColor(if (PD10/major)/Round((PD10/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD10.HideTitle();
PD10.SetPaintingStrategy(PaintingStrategy.horizontal);
PD10.SetLineWeight(1);
plot MD10 = (if ShowMidpoint == 1 then PD10 - Mid else na);
MD10.AssignValueColor(Color.light_gray);
MD10.HideTitle();
MD10.SetPaintingStrategy(PaintingStrategy.dashes);
MD10.SetLineWeight(1);
MD10.Hidebubble();
plot PD11 = ST - (11 * INCREMENT);
PD11.AssignValueColor(if (PD11/major)/Round((PD11/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD11.HideTitle();
PD11.SetPaintingStrategy(PaintingStrategy.horizontal);
PD11.SetLineWeight(1);
plot MD11 = (if ShowMidpoint == 1 then PD11 - Mid else na);
MD11.AssignValueColor(Color.light_gray);
MD11.HideTitle();
MD11.SetPaintingStrategy(PaintingStrategy.dashes);
MD11.SetLineWeight(1);
MD11.Hidebubble();
plot PD12 = ST - (12 * INCREMENT);
PD12.AssignValueColor(if (PD12/major)/Round((PD12/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD12.HideTitle();
PD12.SetPaintingStrategy(PaintingStrategy.horizontal);
PD12.SetLineWeight(1);
plot MD12 = (if ShowMidpoint == 1 then PD12 - Mid else na);
MD12.AssignValueColor(Color.light_gray);
MD12.HideTitle();
MD12.SetPaintingStrategy(PaintingStrategy.dashes);
MD12.SetLineWeight(1);
MD12.Hidebubble();
plot PD13 = ST - (13 * INCREMENT);
PD13.AssignValueColor(if (PD13/major)/Round((PD13/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD13.HideTitle();
PD13.SetPaintingStrategy(PaintingStrategy.horizontal);
PD13.SetLineWeight(1);
plot MD13 = (if ShowMidpoint == 1 then PD13 - Mid else na);
MD13.AssignValueColor(Color.light_gray);
MD13.HideTitle();
MD13.SetPaintingStrategy(PaintingStrategy.dashes);
MD13.SetLineWeight(1);
MD13.Hidebubble();
plot PD14 = ST - (14 * INCREMENT);
PD14.AssignValueColor(if (PD14/major)/Round((PD14/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD14.HideTitle();
PD14.SetPaintingStrategy(PaintingStrategy.horizontal);
PD14.SetLineWeight(1);
plot MD14 = (if ShowMidpoint == 1 then PD14 - Mid else na);
MD14.AssignValueColor(Color.light_gray);
MD14.HideTitle();
MD14.SetPaintingStrategy(PaintingStrategy.dashes);
MD14.SetLineWeight(1);
MD14.Hidebubble();
plot PD15 = ST - (15 * INCREMENT);
PD15.AssignValueColor(if (PD15/major)/Round((PD15/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD15.HideTitle();
PD15.SetPaintingStrategy(PaintingStrategy.horizontal);
PD15.SetLineWeight(1);
plot MD15 = (if ShowMidpoint == 1 then PD15 - Mid else na);
MD15.AssignValueColor(Color.light_gray);
MD15.HideTitle();
MD15.SetPaintingStrategy(PaintingStrategy.dashes);
MD15.SetLineWeight(1);
MD15.Hidebubble();
plot PD16 = ST - (16 * INCREMENT);
PD16.AssignValueColor(if (PD16/major)/Round((PD16/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD16.HideTitle();
PD16.SetPaintingStrategy(PaintingStrategy.horizontal);
PD16.SetLineWeight(1);
plot MD16 = (if ShowMidpoint == 1 then PD16 - Mid else na);
MD16.AssignValueColor(Color.light_gray);
MD16.HideTitle();
MD16.SetPaintingStrategy(PaintingStrategy.dashes);
MD16.SetLineWeight(1);
MD16.Hidebubble();
plot PD17 = ST - (17 * INCREMENT);
PD17.AssignValueColor(if (PD17/major)/Round((PD17/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD17.HideTitle();
PD17.SetPaintingStrategy(PaintingStrategy.horizontal);
PD17.SetLineWeight(1);
plot MD17 = (if ShowMidpoint == 1 then PD17 - Mid else na);
MD17.AssignValueColor(Color.light_gray);
MD17.HideTitle();
MD17.SetPaintingStrategy(PaintingStrategy.dashes);
MD17.SetLineWeight(1);
MD17.Hidebubble();
plot PD18 = ST - (18 * INCREMENT);
PD18.AssignValueColor(if (PD18/major)/Round((PD18/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD18.HideTitle();
PD18.SetPaintingStrategy(PaintingStrategy.horizontal);
PD18.SetLineWeight(1);
plot MD18 = (if ShowMidpoint == 1 then PD18 - Mid else na);
MD18.AssignValueColor(Color.light_gray);
MD18.HideTitle();
MD18.SetPaintingStrategy(PaintingStrategy.dashes);
MD18.SetLineWeight(1);
MD18.Hidebubble();
plot PD19 = ST - (19 * INCREMENT);
PD19.AssignValueColor(if (PD19/major)/Round((PD19/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD19.HideTitle();
PD19.SetPaintingStrategy(PaintingStrategy.horizontal);
PD19.SetLineWeight(1);
plot MD19 = (if ShowMidpoint == 1 then PD19 - Mid else na);
MD19.AssignValueColor(Color.light_gray);
MD19.HideTitle();
MD19.SetPaintingStrategy(PaintingStrategy.dashes);
MD19.SetLineWeight(1);
MD19.Hidebubble();
plot PD20 = ST - (20 * INCREMENT);
PD20.AssignValueColor(if (PD20/major)/Round((PD20/major),0)== 1 then (CreateColor(255, 4, 204)) else Color.white);
PD20.HideTitle();
PD20.SetPaintingStrategy(PaintingStrategy.horizontal);
PD20.SetLineWeight(1);
#Vertical Line at minutes interval
#Sleepyz
input verticle_minutes1 = 5;
input verticle_minutes2 = 15;
input verticle_minutes3 = 30;
def NYbegin = 0930;
def NYend = 1600;
def bar = if SecondsTillTime(NYbegin) == 0 and
SecondsFromTime(NYbegin) == 0
then 0
else bar[1] + 1;
input show_vertical_lines= yes;
AddVerticalLine(if plotgrid and show_vertical_lines and SecondsFromTime(NYbegin) >= 0 and secondsfromTime(NYend)<=0
then bar % (ceil(verticle_minutes1) / (GetAggregationPeriod() / 60000)) == 0
else Double.NaN,
color = Color.light_gray, stroke = Curve.short_dash);
AddVerticalLine(if plotgrid and show_vertical_lines and SecondsFromTime(NYbegin) >= 0 and secondsfromTime(NYend)<=0
then bar % (ceil(verticle_minutes2) / (GetAggregationPeriod() / 60000)) == 0
else Double.NaN,
color = Color.light_gray, stroke = Curve.medium_dash);
AddVerticalLine(if plotgrid and show_vertical_lines and SecondsFromTime(NYbegin) >= 0 and secondsfromTime(NYend)<=0
then bar % (ceil(verticle_minutes3) / (GetAggregationPeriod() / 60000)) == 0
else Double.NaN,
color = Color.light_gray, stroke = Curve.long_dash);