Auto Significant Price Levels for ThinkorSwim

@tradeidea20 I run it on both 1 minute or 2 minute charts along with daily charts. Recopy the code in post #16. I made a couple of modifications, so it should work as stated. Place it on any chart that is based on a tick value of $.01 and it should work. Let me know.

Regards,
Bob
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

@rlohmeyer Bob looking visually with your "Enhanced," reversal, the "dot," incorporated with "High_Low," I'm finding is a VERY good signal for swing/Position and that Dot is the entry area. I haven't observed the dot appearing, but it marks a significant entry off the color bar change.......

DruWgLB.png
 
@Thomas Are you trading these signals yet, or just watching? I am glad the work I did on this is adding some value. For myself, I am finding the Dot not as helpful as I hoped. I am still using your High/Low warning, but I primarily use the Auto Significant Price levels and secondarily, or in combination with, significant S/R: Open, Close, VWAP, 30 minute POC, to determine entry or exit. What I am finding is that I can be out of the market in 60 to 90 minutes after the open, during the time the initial range is being set. Your High/Low gives me warning of a potential reversal in that morning period at a significant price level. The entry is as near to a break of that price level as possible and get out in full, or in part, by the next price level ($.50), and ride any held position further for a swing trade after the scalp. This stock had quite a day Friday. Average 30 Day Percentage Range was over 8% from the regular session High to Low, but Friday it was over 13%. (Shown in the Label at the top marked by the Cyan Arrows) I caught 3 little waves. 1st marked by RED short entry arrow/Green close arrow. The other 2 marked by Green long entry arrow/Red close arrow. Out before 90 minutes. This type of trading suits me. I am not a patient trader, so I can't hang around and watch. Plus I am older, so must keep moving. :)

rWEoLY8.jpg
 
Last edited:
@rlohmeyer Bob, I swing/position, my mind doesn't function quickly for hour trading, I can find set ups, anticipate, but I accumulate and hold for larger gains. Your system confirms a specific entry from colored candles, actually I am independent on entries of signals but they are confirming, as though you missed initial candle entry, well here is second chance. I prefer as much nothing on chart so I can read candle patterns, no offense, it was how I learned. TRADE ON!
 
@Thomas No offense taken. Since 1987 I swung traded over days to months. Since retirement 2 years ago, have been learning day trade process .. Took a year to settle on a system and gain a positive expectancy, with no off the chart indicators. However, I still experiment with on the chart bar/volume indicators to see if it confuses the perceptual process or enhances it. Still learning. Only swing trade months now on indexes. Too many grandkids for any other time expenditure. Have appreciated your feedback. Let me know if you come across any on the chart stuff that could provide visual cues.

I am presently experimenting with a nice Higher Time Frame Bar indicator kindly provided by @Townsend. I have modified his code slightly to get what I want, but it has potential for a confirmation indicator. The image below shows the indicator on the chart from above at the location of my second trade for the AM. It is set to show the beginning of a Higher Time Frame 5 minute bar in Yellow Dashes and the Close of a 5 Minute Bar in either Red or Green Dashes, depending on whether the bar closed down or up. It clearly provides a confirming signal for the trade as it shows the Hi/Lo Signal Bar as the last 1 minute bar of the Higher Time Frame 5 Minute Bar. Also, it was easy to see that this was the 2nd HTF 5 Minute Range Bar that closed on its low since the last 1 minute signal bar. This information along with the VWAP and significant price level could have provided additional confirmation for taking a rather low risk to higher reward trade that took a minute or so to complete. The modified code is below the image. Kudos to @Townsend for the original code.

Regards,
Bob



miiJYGd.jpg


Code:
# Multi-Time-Frame Candle Overlay version 2.4
# 2020 Paul Townsend
# with code from UseThinkScript.com
# 01.25.2020 - BLT - Modified Addcloud to match horizontal lines

input agg = AggregationPeriod.five_min;
input OpenLine = yes;
input CloseLine = no;
input HighLowLines = no;
input HighLowGray = no;
input LineWeight =2;

plot o = open(period = agg);
plot c = close(period = agg);
plot h = high(period = agg);
plot l = low(period = agg);

o.sethiding(!OpenLine);
c.sethiding(!CloseLine);
h.sethiding(!HighLowLines);
l.sethiding(!HighLowLines);

o.setLineWeight(lineweight);
c.setLineWeight(lineweight);
h.setLineWeight(lineweight);
l.setLineWeight(lineweight);

o.SetDefaultColor(Color.yellow);
c.AssignValueColor(if o==c then color.white else if o > c then createcolor(255, 36, 36) else color.green);
h.AssignValueColor(if highlowgray then color.light_gray else if o==c then color.white else if o > c then Color.red else Color.green);
l.AssignValueColor(if highlowgray then color.light_gray else if o==c then color.white else if o > c then Color.red else Color.green);
#input addcloud =yes;
#def side = if side[1] == 1 then 2 else 1; plot sider = side; sider.hide();
#AddCloud( if sider==2 then c else double.nan, o, Color.green, Color.red);
#AddCloud( if sider==1 then c else double.nan, o, color.green, Color.red);

o.SetPaintingStrategy(PaintingStrategy.dashes);
c.SetPaintingStrategy(PaintingStrategy.dashes);
h.SetPaintingStrategy(PaintingStrategy.dashes);
l.SetPaintingStrategy(PaintingStrategy.dashes);

# end

Regards,
Bob
 
Last edited:
@tradeidea20 I run it on both 1 minute or 2 minute charts along with daily charts. Recopy the code in post #16. I made a couple of modifications, so it should work as stated. Place it on any chart that is based on a tick value of $.01 and it should work. Let me know.

Regards,
Bob
@rlohmeyer Thanks it is working on all charts exept /ES and /NQ... Can you please assist? Can you tell me where to change code that tick value of $1 is detected maybe then it will work.. please help me to make it work on nq? thanks!
 
I have posted modified code in post 1 that will auto determine at what whole number level to start the Auto Significant Price levels. However, if there was an overnight gap, you can still set the Auto Significant Price Level to start at as well as your "pli" which is your price level increment that determines the other levels surrounding the start level. The start level is color coded Yellow. See above post for illustration which shows this setup on /NQ. I use it for day trading stocks, but works fine with futures.

Below I have also posted a simple indicator for Significant Daily Lines like the Days Open Price, Yesterday Close, Todays High and Low, as well as Yesterday's High and Low. I have also added Yesterday's Closing VWAP, which as you can see in the chart below attracted significant trade activity and afforded several day trade scalps. I scalp the first hour to 90 minutes, and I am finished for the day. For this type of trading, the Auto Significant Price Levels are most critical for trade entry/exit points, followed closely by the Daily Significant Lines, the Days VWAP, and Volume Profile. (Set for 30 minute time frames) With this info you can "read" the probability of a directional bias for a scalp.
PciYE9p.jpg


Code:
#@rlohmeyer_SRLines
# much code borrowed through UseThinkscript
def AP = aggregationPeriod.DAY;

plot D_Open = open(period = AP);
D_Open.SetDefaultColor(Color.YELLOW);
D_Open.SetPaintingStrategy(PaintingStrategy.points);
D_Open.SetLineWeight(2);
D_Open.HideTitle();
D_Open.HideBubble();

plot Y_Close = close(period =AP)[1];
Y_Close.SetPaintingStrategy(PaintingStrategy.squares);
Y_Close.SetDefaultColor(Color.DARK_ORANGE);
Y_Close.SetLineWeight(2);
Y_Close.HideTitle();
Y_Close.HideBubble();

plot D_High = high(period = AP);
D_High.SetDefaultColor(Color.Green);
D_High.SetPaintingStrategy(PaintingStrategy.points);
D_High.SetLineWeight(2);
D_High.HideTitle();
D_High.HideBubble();

plot D_Low = low(period = AP);
D_Low.SetDefaultColor(Color.RED);
D_Low.SetPaintingStrategy(PaintingStrategy.points);
D_Low.SetLineWeight(2);
D_Low.HideTitle();
D_Low.HideBubble();

plot Y_VWAP =  vwap(period =AP)[1];
Y_VWAP.SetDefaultColor(Color.white);
Y_VWAP.SetPaintingStrategy(PaintingStrategy.dashes);
Y_VWAP.SetLineWeight(3);
Y_VWAP.HideTitle();
Y_VWAP.HideBubble();

plot Y_High = high(period = AP)[1];
Y_High.SetDefaultColor(Color.GREEN);
Y_High.SetPaintingStrategy(PaintingStrategy.squares);
Y_High.SetLineWeight(2);
Y_High.HideTitle();
Y_High.HideBubble();

plot Y_Low =Low(period = AP)[1];
Y_Low.SetDefaultColor(Color.RED);
Y_Low.SetPaintingStrategy(PaintingStrategy.squares);
Y_Low.SetLineWeight(2);
Y_Low.HideTitle();
Y_Low.HideBubble();
 
Hi,

I have updated the code for Auto Significant Price Levels in post 1. It is very easy to use. It will automatically set the starting Significant Price level at the nearest whole number at the days RTH session open, and then populate the other levels above and below based on the PLI input, which can be set at any number or fractional, unlike TOS. I simply add these to the stocks I watch and once you set the inputs, no matter how much the stock might gap, you will see the levels above and below.
 
Two questions:
1) Is there available modification of this code for me to print significant price level such as, Using 5 minute Candle Time Frame, Closing Price at 11:00 am PST, Repaint New Line Daily?
2) Is there available modification of this code for me to print significant price level for Nightly Pre-market Open, Using 5 minute Candle Time Frame, Closing Price at 1:00 am PST (or fist available price), Repaint New Line Daily?
 
@TOS Rookie All times are based on a 24 hour clock (military time) and based on the EST zone... I'm sure that's not the complete answer you wanted but it will help you understand the TOS system a bit better for future reference...
 
@TOS Rookie

Hi,
I have modified the code to give you an option to set your own starting Price Level and then the lines will populate above and below that level based on your PLI number. Just set your own starting level, then the session that you are trading or watching is irrelevant. Hope this helps. Code is below.

Bob

Code:
#Auto Price Levels
#@rlohmeyer shared on UseThinkscript
#updated code 2/17/21
input PLI = 1.00;
input yourLevel = 0;
input showMidpoints = yes;

DefineGlobalColor("PLI",color.white);
DefineGlobalColor("MP",color.light_gray);
def op = open(period = AggregationPeriod.DAY);
def ST = if yourlevel == 0 then Round(op, 0) else yourlevel;
def MP = PLI/2;

#Plot ST
plot PLS = ST;
PLS.SetDefaultColor(color.yellow);
PLS.HideTitle();
PLS.SetPaintingStrategy(PaintingStrategy.dashes);

#ST Up
plot MU1 = if showMidpoints then ST + MP else Double.NaN;
MU1.SetDefaultColor(globalColor("MP"));
MU1.HideTitle();
MU1.SetPaintingStrategy(PaintingStrategy.dashes);
MU1.HideBubble();
plot PU1 = if ST > 0 then ST + PLI else Double.NaN;
PU1.SetDefaultColor(globalColor("PLI"));
PU1.HideTitle();
PU1.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU2 = if showMidpoints then PU1 + MP else Double.NaN;
MU2.SetDefaultColor(globalColor("MP"));
MU2.HideTitle();
MU2.SetPaintingStrategy(PaintingStrategy.dashes);
MU2.HideBubble();
plot PU2 = if ST > 0 then ST + (2 * PLI)else Double.NaN;
PU2.SetDefaultColor(globalColor("PLI"));
PU2.HideTitle();
PU2.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU3 = if showMidpoints then PU2 +  MP else Double.NaN;
MU3.SetDefaultColor(globalColor("MP"));
MU3.HideTitle();
MU3.SetPaintingStrategy(PaintingStrategy.dashes);
MU3.HideBubble();
plot PU3 = if ST > 0 then ST + (3 * PLI)else Double.NaN;
PU3.SetDefaultColor(globalColor("PLI"));
PU3.HideTitle();
PU3.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU4 = if showMidpoints then PU3 + MP else Double.NaN;
MU4.SetDefaultColor(globalColor("MP"));
MU4.HideTitle();
MU4.SetPaintingStrategy(PaintingStrategy.dashes);
MU4.HideBubble();
plot PU4 = if ST > 0 then ST + (4 * PLI)else Double.NaN;
PU4.SetDefaultColor(globalColor("PLI"));
PU4.HideTitle();
PU4.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU5 = if showMidpoints then PU4 + MP else Double.NaN;
MU5.SetDefaultColor(globalColor("MP"));
MU5.HideTitle();
MU5.SetPaintingStrategy(PaintingStrategy.dashes);
MU5.HideBubble();
plot PU5 = if ST > 0 then ST + (5 * PLI)else Double.NaN;
PU5.SetDefaultColor(globalColor("PLI"));
PU5.HideTitle();
PU5.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU6 = if showMidpoints then PU5 + MP else Double.NaN;
MU6.SetDefaultColor(globalColor("MP"));
MU6.HideTitle();
MU6.SetPaintingStrategy(PaintingStrategy.dashes);
MU6.HideBubble();
plot PU6 = if ST > 0 then ST + (6 * PLI)else Double.NaN;
PU6.SetDefaultColor(globalColor("PLI"));
PU6.HideTitle();
PU6.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU7 = if showMidpoints then PU6 + MP else Double.NaN;
MU7.SetDefaultColor(globalColor("MP"));
MU7.HideTitle();
MU7.SetPaintingStrategy(PaintingStrategy.dashes);
MU7.HideBubble();
plot PU7 = if ST > 0 then ST + (7 * PLI)else Double.NaN;
PU7.SetDefaultColor(globalColor("PLI"));
PU7.HideTitle();
PU7.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU8 = if showMidpoints then PU7 + MP else Double.NaN;
MU8.SetDefaultColor(globalColor("MP"));
MU8.HideTitle();
MU8.SetPaintingStrategy(PaintingStrategy.dashes);
MU8.HideBubble();
plot PU8 = if ST > 0 then ST + (8 * PLI)else Double.NaN;
PU8.SetDefaultColor(globalColor("PLI"));
PU8.HideTitle();
PU8.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU9 = if showMidpoints then PU8 + MP else Double.NaN;
MU9.SetDefaultColor(globalColor("MP"));
MU9.HideTitle();
MU9.SetPaintingStrategy(PaintingStrategy.dashes);
MU9.HideBubble();
plot PU9 = if ST > 0 then ST + (9 * PLI)else Double.NaN;
PU9.SetDefaultColor(globalColor("PLI"));
PU9.HideTitle();
PU9.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU10 = if showMidpoints then PU9 + MP else Double.NaN;
MU10.SetDefaultColor(globalColor("MP"));
MU10.HideTitle();
MU10.SetPaintingStrategy(PaintingStrategy.dashes);
MU10.HideBubble();
plot PU10 = if ST > 0 then ST + (10 * PLI)else Double.NaN;
PU10.SetDefaultColor(globalColor("PLI"));
PU10.HideTitle();
PU10.SetPaintingStrategy(PaintingStrategy.dashes);


#STDown
plot MD1 = if showMidpoints then ST - MP else Double.NaN;
MD1.SetDefaultColor(globalColor("MP"));
MD1.HideTitle();
MD1.SetPaintingStrategy(PaintingStrategy.dashes);
MD1.HideBubble();
plot PD1 = if ST > 0 then ST - PLI else Double.NaN;
PD1 .SetDefaultColor(globalColor("PLI"));
PD1 .HideTitle();
PD1 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD2 = if showMidpoints then PD1 - MP else Double.NaN;
MD2 .SetDefaultColor(globalColor("MP"));
MD2 .HideTitle();
MD2 .SetPaintingStrategy(PaintingStrategy.dashes);
MD2 .HideBubble();
plot PD2 = if ST > 0 then ST - (2 * PLI) else Double.NaN;
PD2 .SetDefaultColor(globalColor("PLI"));
PD2 .HideTitle();
PD2 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD3 = if showMidpoints then PD2 - MP else Double.NaN;
MD3 .SetDefaultColor(globalColor("MP"));
MD3 .HideTitle();
MD3 .SetPaintingStrategy(PaintingStrategy.dashes);
MD3 .HideBubble();
plot PD3 = if ST > 0 then ST - (3 * PLI)else Double.NaN;
PD3 .SetDefaultColor(globalColor("PLI"));
PD3 .HideTitle();
PD3 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD4 = if showMidpoints then PD3 - MP else Double.NaN;
MD4 .SetDefaultColor(globalColor("MP"));
MD4 .HideTitle();
MD4 .SetPaintingStrategy(PaintingStrategy.dashes);
MD4 .HideBubble();
plot PD4 = if ST > 0 then ST - (4 * PLI)else Double.NaN;
PD4 .SetDefaultColor(globalColor("PLI"));
PD4 .HideTitle();
PD4 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD5 = if showMidpoints then PD4 - MP else Double.NaN;
MD5 .SetDefaultColor(globalColor("MP"));
MD5 .HideTitle();
MD5 .SetPaintingStrategy(PaintingStrategy.dashes);
MD5 .HideBubble();
plot PD5 = if ST > 0 then ST - (5 * PLI)else Double.NaN;
PD5 .SetDefaultColor(globalColor("PLI"));
PD5 .HideTitle();
PD5 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD6 = if showMidpoints then PD5 - MP else Double.NaN;
MD6 .SetDefaultColor(globalColor("MP"));
MD6 .HideTitle();
MD6 .SetPaintingStrategy(PaintingStrategy.dashes);
MD6 .HideBubble();
plot PD6 = if ST > 0 then ST - (6 * PLI)else Double.NaN;
PD6 .SetDefaultColor(globalColor("PLI"));
PD6 .HideTitle();
PD6 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD7 = if showMidpoints then PD6 - MP else Double.NaN;
MD7 .SetDefaultColor(globalColor("MP"));
MD7 .HideTitle();
MD7 .SetPaintingStrategy(PaintingStrategy.dashes);
MD7 .HideBubble();
plot PD7 = if ST > 0 then ST - (7 * PLI)else Double.NaN;
PD7 .SetDefaultColor(globalColor("PLI"));
PD7 .HideTitle();
PD7 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD8 = if showMidpoints then PD7 - MP else Double.NaN;
MD8 .SetDefaultColor(globalColor("MP"));
MD8 .HideTitle();
MD8 .SetPaintingStrategy(PaintingStrategy.dashes);
MD8 .HideBubble();
plot PD8 = if ST > 0 then ST - (8 * PLI)else Double.NaN;
PD8 .SetDefaultColor(globalColor("PLI"));
PD8 .HideTitle();
PD8 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD9 = if showMidpoints then PD8 - MP else Double.NaN;
MD9 .SetDefaultColor(globalColor("MP"));
MD9.HideTitle();
MD9 .SetPaintingStrategy(PaintingStrategy.dashes);
MD9.HideBubble();
plot PD9 = if ST > 0 then ST - (9 * PLI)else Double.NaN;
PD9 .SetDefaultColor(globalColor("PLI"));
PD9 .HideTitle();
PD9 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD10 = if showMidpoints then PD9 - MP else Double.NaN;
MD10 .SetDefaultColor(globalColor("MP"));
MD10.HideTitle();
MD10 .SetPaintingStrategy(PaintingStrategy.dashes);
MD10.HideBubble();
plot PD10 = if ST > 0 then ST - (10 * PLI)else Double.NaN;
PD10 .SetDefaultColor(globalColor("PLI"));
PD10 .HideTitle();
PD10 .SetPaintingStrategy(PaintingStrategy.dashes);
 
@TOS Rookie

Hi,
I have modified the code to give you an option to set your own starting Price Level and then the lines will populate above and below that level based on your PLI number. Just set your own starting level, then the session that you are trading or watching is irrelevant. Hope this helps. Code is below.

Bob

Code:
#Auto Price Levels
#@rlohmeyer shared on UseThinkscript
#updated code 2/17/21
input PLI = 1.00;
input yourLevel = 0;
input showMidpoints = yes;

DefineGlobalColor("PLI",color.white);
DefineGlobalColor("MP",color.light_gray);
def op = open(period = AggregationPeriod.DAY);
def ST = if yourlevel == 0 then Round(op, 0) else yourlevel;
def MP = PLI/2;

#Plot ST
plot PLS = ST;
PLS.SetDefaultColor(color.yellow);
PLS.HideTitle();
PLS.SetPaintingStrategy(PaintingStrategy.dashes);

#ST Up
plot MU1 = if showMidpoints then ST + MP else Double.NaN;
MU1.SetDefaultColor(globalColor("MP"));
MU1.HideTitle();
MU1.SetPaintingStrategy(PaintingStrategy.dashes);
MU1.HideBubble();
plot PU1 = if ST > 0 then ST + PLI else Double.NaN;
PU1.SetDefaultColor(globalColor("PLI"));
PU1.HideTitle();
PU1.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU2 = if showMidpoints then PU1 + MP else Double.NaN;
MU2.SetDefaultColor(globalColor("MP"));
MU2.HideTitle();
MU2.SetPaintingStrategy(PaintingStrategy.dashes);
MU2.HideBubble();
plot PU2 = if ST > 0 then ST + (2 * PLI)else Double.NaN;
PU2.SetDefaultColor(globalColor("PLI"));
PU2.HideTitle();
PU2.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU3 = if showMidpoints then PU2 +  MP else Double.NaN;
MU3.SetDefaultColor(globalColor("MP"));
MU3.HideTitle();
MU3.SetPaintingStrategy(PaintingStrategy.dashes);
MU3.HideBubble();
plot PU3 = if ST > 0 then ST + (3 * PLI)else Double.NaN;
PU3.SetDefaultColor(globalColor("PLI"));
PU3.HideTitle();
PU3.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU4 = if showMidpoints then PU3 + MP else Double.NaN;
MU4.SetDefaultColor(globalColor("MP"));
MU4.HideTitle();
MU4.SetPaintingStrategy(PaintingStrategy.dashes);
MU4.HideBubble();
plot PU4 = if ST > 0 then ST + (4 * PLI)else Double.NaN;
PU4.SetDefaultColor(globalColor("PLI"));
PU4.HideTitle();
PU4.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU5 = if showMidpoints then PU4 + MP else Double.NaN;
MU5.SetDefaultColor(globalColor("MP"));
MU5.HideTitle();
MU5.SetPaintingStrategy(PaintingStrategy.dashes);
MU5.HideBubble();
plot PU5 = if ST > 0 then ST + (5 * PLI)else Double.NaN;
PU5.SetDefaultColor(globalColor("PLI"));
PU5.HideTitle();
PU5.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU6 = if showMidpoints then PU5 + MP else Double.NaN;
MU6.SetDefaultColor(globalColor("MP"));
MU6.HideTitle();
MU6.SetPaintingStrategy(PaintingStrategy.dashes);
MU6.HideBubble();
plot PU6 = if ST > 0 then ST + (6 * PLI)else Double.NaN;
PU6.SetDefaultColor(globalColor("PLI"));
PU6.HideTitle();
PU6.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU7 = if showMidpoints then PU6 + MP else Double.NaN;
MU7.SetDefaultColor(globalColor("MP"));
MU7.HideTitle();
MU7.SetPaintingStrategy(PaintingStrategy.dashes);
MU7.HideBubble();
plot PU7 = if ST > 0 then ST + (7 * PLI)else Double.NaN;
PU7.SetDefaultColor(globalColor("PLI"));
PU7.HideTitle();
PU7.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU8 = if showMidpoints then PU7 + MP else Double.NaN;
MU8.SetDefaultColor(globalColor("MP"));
MU8.HideTitle();
MU8.SetPaintingStrategy(PaintingStrategy.dashes);
MU8.HideBubble();
plot PU8 = if ST > 0 then ST + (8 * PLI)else Double.NaN;
PU8.SetDefaultColor(globalColor("PLI"));
PU8.HideTitle();
PU8.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU9 = if showMidpoints then PU8 + MP else Double.NaN;
MU9.SetDefaultColor(globalColor("MP"));
MU9.HideTitle();
MU9.SetPaintingStrategy(PaintingStrategy.dashes);
MU9.HideBubble();
plot PU9 = if ST > 0 then ST + (9 * PLI)else Double.NaN;
PU9.SetDefaultColor(globalColor("PLI"));
PU9.HideTitle();
PU9.SetPaintingStrategy(PaintingStrategy.dashes);
plot MU10 = if showMidpoints then PU9 + MP else Double.NaN;
MU10.SetDefaultColor(globalColor("MP"));
MU10.HideTitle();
MU10.SetPaintingStrategy(PaintingStrategy.dashes);
MU10.HideBubble();
plot PU10 = if ST > 0 then ST + (10 * PLI)else Double.NaN;
PU10.SetDefaultColor(globalColor("PLI"));
PU10.HideTitle();
PU10.SetPaintingStrategy(PaintingStrategy.dashes);


#STDown
plot MD1 = if showMidpoints then ST - MP else Double.NaN;
MD1.SetDefaultColor(globalColor("MP"));
MD1.HideTitle();
MD1.SetPaintingStrategy(PaintingStrategy.dashes);
MD1.HideBubble();
plot PD1 = if ST > 0 then ST - PLI else Double.NaN;
PD1 .SetDefaultColor(globalColor("PLI"));
PD1 .HideTitle();
PD1 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD2 = if showMidpoints then PD1 - MP else Double.NaN;
MD2 .SetDefaultColor(globalColor("MP"));
MD2 .HideTitle();
MD2 .SetPaintingStrategy(PaintingStrategy.dashes);
MD2 .HideBubble();
plot PD2 = if ST > 0 then ST - (2 * PLI) else Double.NaN;
PD2 .SetDefaultColor(globalColor("PLI"));
PD2 .HideTitle();
PD2 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD3 = if showMidpoints then PD2 - MP else Double.NaN;
MD3 .SetDefaultColor(globalColor("MP"));
MD3 .HideTitle();
MD3 .SetPaintingStrategy(PaintingStrategy.dashes);
MD3 .HideBubble();
plot PD3 = if ST > 0 then ST - (3 * PLI)else Double.NaN;
PD3 .SetDefaultColor(globalColor("PLI"));
PD3 .HideTitle();
PD3 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD4 = if showMidpoints then PD3 - MP else Double.NaN;
MD4 .SetDefaultColor(globalColor("MP"));
MD4 .HideTitle();
MD4 .SetPaintingStrategy(PaintingStrategy.dashes);
MD4 .HideBubble();
plot PD4 = if ST > 0 then ST - (4 * PLI)else Double.NaN;
PD4 .SetDefaultColor(globalColor("PLI"));
PD4 .HideTitle();
PD4 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD5 = if showMidpoints then PD4 - MP else Double.NaN;
MD5 .SetDefaultColor(globalColor("MP"));
MD5 .HideTitle();
MD5 .SetPaintingStrategy(PaintingStrategy.dashes);
MD5 .HideBubble();
plot PD5 = if ST > 0 then ST - (5 * PLI)else Double.NaN;
PD5 .SetDefaultColor(globalColor("PLI"));
PD5 .HideTitle();
PD5 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD6 = if showMidpoints then PD5 - MP else Double.NaN;
MD6 .SetDefaultColor(globalColor("MP"));
MD6 .HideTitle();
MD6 .SetPaintingStrategy(PaintingStrategy.dashes);
MD6 .HideBubble();
plot PD6 = if ST > 0 then ST - (6 * PLI)else Double.NaN;
PD6 .SetDefaultColor(globalColor("PLI"));
PD6 .HideTitle();
PD6 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD7 = if showMidpoints then PD6 - MP else Double.NaN;
MD7 .SetDefaultColor(globalColor("MP"));
MD7 .HideTitle();
MD7 .SetPaintingStrategy(PaintingStrategy.dashes);
MD7 .HideBubble();
plot PD7 = if ST > 0 then ST - (7 * PLI)else Double.NaN;
PD7 .SetDefaultColor(globalColor("PLI"));
PD7 .HideTitle();
PD7 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD8 = if showMidpoints then PD7 - MP else Double.NaN;
MD8 .SetDefaultColor(globalColor("MP"));
MD8 .HideTitle();
MD8 .SetPaintingStrategy(PaintingStrategy.dashes);
MD8 .HideBubble();
plot PD8 = if ST > 0 then ST - (8 * PLI)else Double.NaN;
PD8 .SetDefaultColor(globalColor("PLI"));
PD8 .HideTitle();
PD8 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD9 = if showMidpoints then PD8 - MP else Double.NaN;
MD9 .SetDefaultColor(globalColor("MP"));
MD9.HideTitle();
MD9 .SetPaintingStrategy(PaintingStrategy.dashes);
MD9.HideBubble();
plot PD9 = if ST > 0 then ST - (9 * PLI)else Double.NaN;
PD9 .SetDefaultColor(globalColor("PLI"));
PD9 .HideTitle();
PD9 .SetPaintingStrategy(PaintingStrategy.dashes);
plot MD10 = if showMidpoints then PD9 - MP else Double.NaN;
MD10 .SetDefaultColor(globalColor("MP"));
MD10.HideTitle();
MD10 .SetPaintingStrategy(PaintingStrategy.dashes);
MD10.HideBubble();
plot PD10 = if ST > 0 then ST - (10 * PLI)else Double.NaN;
PD10 .SetDefaultColor(globalColor("PLI"));
PD10 .HideTitle();
PD10 .SetPaintingStrategy(PaintingStrategy.dashes);
Whats PLI ?? how to use this with NQ futures? Any guidance will be helpful. Thanks in advance
 
@TOS Rookie
PLI simply means "Price Line Increment". When you set that number at say .50, then every major line will be at a $.50 level, such as 38.50 or 40 or 40.50, and the midpoint lines will draw at each .25 level.
Bob
 
@TOS Rookie
Below is a screen shot of a stock I am trading and you can see the levels put there by the indicator. You can also see how price reacted to the 38.50 level. Shortly later I took another short trade at that level and it was successful.
XADU5ZN.jpg
 
I am posting updated code for what I refer to as a Price_Time_Grid. I use it daily now, and it is very useful for the type of trading I prefer, short scalps from less than a minute to rarely more than 3.
Thanks to @SleepyZ @generic and @OBW with code questions when I got stuck. And to answer your question @generic, the code formula you suggested is in this code to allow me to identify and color certain price levels, such as that at 45, that generally become targets and S/R in certain stocks, such as is evident in the graphic for todays trade. Once price accepted this level, it was up and away.

The code is included after the graphic, which shows this on a stock I traded today.
vnudznZ.jpg


Code:
#PriceTimeGrid
#@rlohmeyer shared on UseThinkscript
#Thanks to @OBW, @SleepyZ, and @Generic when I got stuck with code
# 3/11/2021

input increment = 1.00;
input major = 5;
input showMidpoints = yes;
input yourLevel = 0;

DefineGlobalColor ("MAJOR",CreateColor(192, 104, 222));
DefineGlobalColor("INCREMENT",color.light_gray);
def op = open(period = AggregationPeriod.DAY);
def mo = Round(op / major, 0) * major;
def ST = if yourLevel == 0 then Round(op / major, 0) * major else yourLevel;
def MP = INCREMENT/2;

#Plot ST
plot PLS = ST;
PLS.SetDefaultColor(globalColor(“MAJOR”));
PLS.HideTitle();
PLS.SetPaintingStrategy(PaintingStrategy.horizontal);
PLS.SetLineWeight(2);

#ST Up
plot MU1 = if showMidpoints then ST + MP else Double.NaN;
MU1.SetDefaultColor(globalColor(“INCREMENT”));
MU1.HideTitle();
MU1.SetPaintingStrategy(PaintingStrategy.dashes);
MU1.HideBubble();
MU1.SetLineWeight(1);
plot PU1 = if ST > 0 then ST + INCREMENT else Double.NaN;
PU1.SetDefaultColor(globalColor("INCREMENT"));
PU1.HideTitle();
PU1.SetPaintingStrategy(PaintingStrategy.horizontal);
PU1.SetLineWeight(1);
plot MU2 = if showMidpoints then PU1 + MP else Double.NaN;
MU2.SetDefaultColor(globalColor(“INCREMENT”));
MU2.HideTitle();
MU2.SetPaintingStrategy(PaintingStrategy.dashes);
MU2.HideBubble();
MU2.SetLineWeight(1);
plot PU2 = if ST > 0 then ST + (2 * INCREMENT)else Double.NaN;
PU2.SetDefaultColor(globalColor("INCREMENT"));
PU2.HideTitle();
PU2.SetPaintingStrategy(PaintingStrategy.horizontal);
PU2.SetLineWeight(1);
plot MU3 = if showMidpoints then PU2 +  MP else Double.NaN;
MU3.SetDefaultColor(globalColor(“INCREMENT”));
MU3.HideTitle();
MU3.SetPaintingStrategy(PaintingStrategy.dashes);
MU3.HideBubble();
MU3.SetLineWeight(1);
plot PU3 = if ST > 0 then ST + (3 * INCREMENT)else Double.NaN;
PU3.SetDefaultColor(globalColor("INCREMENT"));
PU3.HideTitle();
PU3.SetPaintingStrategy(PaintingStrategy.horizontal);
PU3.SetLineWeight(1);
plot MU4 = if showMidpoints then PU3 + MP else Double.NaN;
MU4.SetDefaultColor(globalColor(“INCREMENT”));
MU4.HideTitle();
MU4.SetPaintingStrategy(PaintingStrategy.dashes);
MU4.HideBubble();
MU4.SetLineWeight(1);
plot PU4 = if ST > 0 then ST + (4 * INCREMENT)else Double.NaN;
PU4.SetDefaultColor(globalColor("INCREMENT"));
PU4.HideTitle();
PU4.SetPaintingStrategy(PaintingStrategy.horizontal);
PU4.SetLineWeight(1);
plot MU5 = if showMidpoints then PU4 + MP else Double.NaN;
MU5.SetDefaultColor(globalColor(“INCREMENT”));
MU5.HideTitle();
MU5.SetPaintingStrategy(PaintingStrategy.dashes);
MU5.HideBubble();
MU5.SetLineWeight(1);
plot PU5 = if ST > 0 then ST + (5 * INCREMENT)else Double.NaN;
PU5.AssignValueColor (if (PU5/5)/round((PU5/5),0)==1 then CreateColor(192, 104, 222) else COLOR.LIGHT_GRAY);
PU5.HideTitle();
PU5.SetPaintingStrategy(PaintingStrategy.horizontal);
PU5.SetLineWeight(1);
plot MU6 = if showMidpoints then PU5 + MP else Double.NaN;
MU6.SetDefaultColor(globalColor(“INCREMENT”));
MU6.HideTitle();
MU6.SetPaintingStrategy(PaintingStrategy.dashes);
MU6.HideBubble();
MU6.SetLineWeight(1);
plot PU6 = if ST > 0 then ST + (6 * INCREMENT)else Double.NaN;
PU6.SetDefaultColor(globalColor("INCREMENT"));
PU6.HideTitle();
PU6.SetPaintingStrategy(PaintingStrategy.horizontal);
PU6.SetLineWeight(1);
plot MU7 = if showMidpoints then PU6 + MP else Double.NaN;
MU7.SetDefaultColor(globalColor(“INCREMENT”));
MU7.HideTitle();
MU7.SetPaintingStrategy(PaintingStrategy.dashes);
MU7.HideBubble();
MU7.SetLineWeight(1);
plot PU7 = if ST > 0 then ST + (7 * INCREMENT)else Double.NaN;
PU7.SetDefaultColor(globalColor("INCREMENT"));
PU7.HideTitle();
PU7.SetPaintingStrategy(PaintingStrategy.horizontal);
PU7.SetLineWeight(1);
plot MU8 = if showMidpoints then PU7 + MP else Double.NaN;
MU8.SetDefaultColor(globalColor(“INCREMENT”));
MU8.HideTitle();
MU8.SetPaintingStrategy(PaintingStrategy.dashes);
MU8.HideBubble();
MU8.SetLineWeight(1);
plot PU8 = if ST > 0 then ST + (8 * INCREMENT)else Double.NaN;
PU8.SetDefaultColor(globalColor("INCREMENT"));
PU8.HideTitle();
PU8.SetPaintingStrategy(PaintingStrategy.horizontal);
PU8.SetLineWeight(1);
plot MU9 = if showMidpoints then PU8 + MP else Double.NaN;
MU9.SetDefaultColor(globalColor(“INCREMENT”));
MU9.HideTitle();
MU9.SetPaintingStrategy(PaintingStrategy.dashes);
MU9.HideBubble();
MU9.SetLineWeight(1); 
plot PU9 = if ST > 0 then ST + (9 * INCREMENT)else Double.NaN;
PU9.SetDefaultColor(globalColor("INCREMENT"));
PU9.HideTitle();
PU9.SetPaintingStrategy(PaintingStrategy.horizontal);
PU9.SetLineWeight(1);
plot MU10 = if showMidpoints then PU9 + MP else Double.NaN;
MU10.SetDefaultColor(globalColor(“INCREMENT”));
MU10.HideTitle();
MU10.SetPaintingStrategy(PaintingStrategy.dashes);
MU10.HideBubble();
MU10.SetLineWeight(1); 
plot PU10 = if ST > 0 then ST + (10 * INCREMENT)else Double.NaN;
PU10.AssignValueColor (if (PU10/5)/round((PU10/5),0)==1 then CreateColor(192, 104, 222) else COLOR.LIGHT_GRAY);
PU10.HideTitle();
PU10.SetPaintingStrategy(PaintingStrategy.horizontal);
PU10.SetLineWeight(1);
plot MU11 = if showMidpoints then PU10 + MP else Double.NaN;
MU11.SetDefaultColor(globalColor(“INCREMENT”));
MU11.HideTitle();
MU11.SetPaintingStrategy(PaintingStrategy.dashes);
MU11.HideBubble();
MU11.SetLineWeight(1); 
plot PU11 = if ST > 0 then ST + (11 * INCREMENT)else Double.NaN;
PU11.SetDefaultColor(globalColor(“INCREMENT”));
PU11.HideTitle();
PU11.SetPaintingStrategy(PaintingStrategy.horizontal);
PU11.SetLineWeight(1);
plot MU12 = if showMidpoints then PU11 + MP else Double.NaN;
MU12.SetDefaultColor(globalColor(“INCREMENT”));
MU12.HideTitle();
MU12.SetPaintingStrategy(PaintingStrategy.dashes);
MU12.HideBubble();
MU12.SetLineWeight(1); 
plot PU12 = if ST > 0 then ST + (12 * INCREMENT)else Double.NaN;
PU12.SetDefaultColor(globalColor(“INCREMENT”));
PU12.HideTitle();
PU12.SetPaintingStrategy(PaintingStrategy.horizontal);
PU12.SetLineWeight(1);
plot MU13 = if showMidpoints then PU12 + MP else Double.NaN;
MU13.SetDefaultColor(globalColor(“INCREMENT”));
MU13.HideTitle();
MU13.SetPaintingStrategy(PaintingStrategy.dashes);
MU13.HideBubble();
MU13.SetLineWeight(1); 
plot PU13 = if ST > 0 then ST + (13 * INCREMENT)else Double.NaN;
PU13.SetDefaultColor(globalColor(“INCREMENT”));
PU13.HideTitle();
PU13.SetPaintingStrategy(PaintingStrategy.horizontal);
PU13.SetLineWeight(1);
plot MU14 = if showMidpoints then PU13 + MP else Double.NaN;
MU14.SetDefaultColor(globalColor(“INCREMENT”));
MU14.HideTitle();
MU14.SetPaintingStrategy(PaintingStrategy.dashes);
MU14.HideBubble();
MU14.SetLineWeight(1); 
plot PU14 = if ST > 0 then ST + (14 * INCREMENT)else Double.NaN;
PU14.SetDefaultColor(globalColor(“INCREMENT”));
PU14.HideTitle();
PU14.SetPaintingStrategy(PaintingStrategy.horizontal);
PU14.SetLineWeight(1);
plot MU15 = if showMidpoints then PU14 + MP else Double.NaN;
MU15.SetDefaultColor(globalColor(“INCREMENT”));
MU15.HideTitle();
MU15.SetPaintingStrategy(PaintingStrategy.dashes);
MU15.HideBubble();
MU15.SetLineWeight(1); 
plot PU15 = if ST > 0 then ST + (15 * INCREMENT)else Double.NaN;
PU15.AssignValueColor (if (PU15/5)/round((PU15/5),0)==1 then CreateColor(192, 104, 222) else COLOR.LIGHT_GRAY);
PU15.HideTitle();
PU15.SetPaintingStrategy(PaintingStrategy.horizontal);
PU15.SetLineWeight(1);

#STDown
plot MD1 = if showMidpoints then ST - MP else Double.NaN;
MD1.SetDefaultColor(globalColor(“INCREMENT”));
MD1.HideTitle();
MD1.SetPaintingStrategy(PaintingStrategy.dashes);
MD1.HideBubble();
MD1.SetLineWeight(1);
plot PD1 = if ST > 0 then ST - INCREMENT else Double.NaN;
PD1.SetDefaultColor(globalColor("INCREMENT"));
PD1.HideTitle();
PD1.SetPaintingStrategy(PaintingStrategy.horizontal);
PD1.SetLineWeight(1);
plot MD2 = if showMidpoints then PD1 - MP else Double.NaN;
MD2.SetDefaultColor(globalColor(“INCREMENT”));
MD2.HideTitle();
MD2.SetPaintingStrategy(PaintingStrategy.dashes);
MD2.HideBubble();
MD2.SetLineWeight(1);
plot PD2 = if ST > 0 then ST - (2 * INCREMENT) else Double.NaN;
PD2.SetDefaultColor(globalColor("INCREMENT"));
PD2.HideTitle();
PD2.SetPaintingStrategy(PaintingStrategy.horizontal);
PD2.SetLineWeight(1);
plot MD3 = if showMidpoints then PD2 - MP else Double.NaN;
MD3.SetDefaultColor(globalColor(“INCREMENT”));
MD3.HideTitle();
MD3.SetPaintingStrategy(PaintingStrategy.dashes);
MD3.HideBubble();
MD3.SetLineWeight(1);
plot PD3 = if ST > 0 then ST - (3 * INCREMENT)else Double.NaN;
PD3.SetDefaultColor(globalColor("INCREMENT"));
PD3.HideTitle();
PD3.SetPaintingStrategy(PaintingStrategy.horizontal);
PD3.SetLineWeight(1);
plot MD4 = if showMidpoints then PD3 - MP else Double.NaN;
MD4.SetDefaultColor(globalColor(“INCREMENT”));
MD4.HideTitle();
MD4.SetPaintingStrategy(PaintingStrategy.dashes);
MD4.HideBubble();
MD4.SetLineWeight(1);
plot PD4 = if ST > 0 then ST - (4 * INCREMENT)else Double.NaN;
PD4.SetDefaultColor(globalColor("INCREMENT"));
PD4.HideTitle();
PD4.SetPaintingStrategy(PaintingStrategy.horizontal);
PD4.SetLineWeight(1);
plot MD5 = if showMidpoints then PD4 - MP else Double.NaN;
MD5.SetDefaultColor(globalColor(“INCREMENT”));
MD5.HideTitle();
MD5.SetPaintingStrategy(PaintingStrategy.dashes);
MD5.HideBubble();
MD5.SetLineWeight(1);
plot PD5 = if ST > 0 then ST - (5 * INCREMENT)else Double.NaN;
PD5.AssignValueColor (if(PD5/5)/round((PD5/5),0)==1 then CreateColor(192, 104, 222) else COLOR.LIGHT_GRAY);
PD5.HideTitle();
PD5.SetPaintingStrategy(PaintingStrategy.horizontal);
PD5.SetLineWeight(1);
plot MD6 = if showMidpoints then PD5 - MP else Double.NaN;
MD6.SetDefaultColor(globalColor(“INCREMENT”));
MD6.HideTitle();
MD6.SetPaintingStrategy(PaintingStrategy.dashes);
MD6.HideBubble();
MD6.SetLineWeight(1);
plot PD6 = if ST > 0 then ST - (6 * INCREMENT)else Double.NaN;
PD6.SetDefaultColor(globalColor("INCREMENT"));
PD6.HideTitle();
PD6.SetPaintingStrategy(PaintingStrategy.horizontal);
PD6.SetLineWeight(1);
plot MD7 = if showMidpoints then PD6 - MP else Double.NaN;
MD7.SetDefaultColor(globalColor(“INCREMENT”));
MD7.HideTitle();
MD7.SetPaintingStrategy(PaintingStrategy.dashes);
MD7.HideBubble();
MD7.SetLineWeight(1);
plot PD7 = if ST > 0 then ST - (7 * INCREMENT)else Double.NaN;
PD7.SetDefaultColor(globalColor("INCREMENT"));
PD7.HideTitle();
PD7.SetPaintingStrategy(PaintingStrategy.horizontal);
PD7.SetLineWeight(1);
plot MD8 = if showMidpoints then PD7 - MP else Double.NaN;
MD8.SetDefaultColor(globalColor(“INCREMENT”));
MD8.HideTitle();
MD8.SetPaintingStrategy(PaintingStrategy.dashes);
MD8.HideBubble();
MD8.SetLineWeight(1);
plot PD8 = if ST > 0 then ST - (8 * INCREMENT)else Double.NaN;
PD8.SetDefaultColor(globalColor("INCREMENT"));
PD8.HideTitle();
PD8.SetPaintingStrategy(PaintingStrategy.horizontal);
PD8.SetLineWeight(1);
plot MD9 = if showMidpoints then PD8 - MP else Double.NaN;
MD9.SetDefaultColor(globalColor(“INCREMENT”));
MD9.HideTitle();
MD9.SetPaintingStrategy(PaintingStrategy.dashes);
MD9.HideBubble();
MD9.SetLineWeight(1);
plot PD9 = if ST > 0 then ST - (9 * INCREMENT)else Double.NaN;
PD9.SetDefaultColor(globalColor("INCREMENT"));
PD9.HideTitle();
PD9.SetPaintingStrategy(PaintingStrategy.horizontal);
PD9.SetLineWeight(1);
plot MD10 = if showMidpoints then PD9 - MP else Double.NaN;
MD10.SetDefaultColor(globalColor(“INCREMENT”));
MD10.HideTitle();
MD10.SetPaintingStrategy(PaintingStrategy.dashes);
MD10.HideBubble();
MD10.SetLineWeight(1);
plot PD10 = if ST > 0 then ST - (10 * INCREMENT)else Double.NaN;
PD10.AssignValueColor (if (PD10/5)/round((PD10/5),0)==1 then CreateColor(192, 104, 222) else COLOR.LIGHT_GRAY);
PD10.HideTitle();
PD10.SetPaintingStrategy(PaintingStrategy.horizontal);
PD10.SetLineWeight(1);
plot MD11 = if showMidpoints then PD10 - MP else Double.NaN;
MD11.SetDefaultColor(globalColor(“INCREMENT”));
MD11.HideTitle();
MD11.SetPaintingStrategy(PaintingStrategy.dashes);
MD11.HideBubble();
MD11.SetLineWeight(1);
plot PD11 = if ST > 0 then ST - (11 * INCREMENT)else Double.NaN;
PD11.SetDefaultColor(globalColor(“INCREMENT”));
PD11.HideTitle();
PD11.SetPaintingStrategy(PaintingStrategy.horizontal);
PD11.SetLineWeight(1);
plot MD12 = if showMidpoints then PD11 - MP else Double.NaN;
MD12.SetDefaultColor(globalColor(“INCREMENT”));
MD12.HideTitle();
MD12.SetPaintingStrategy(PaintingStrategy.dashes);
MD12.HideBubble();
MD12.SetLineWeight(1);
plot PD12 = if ST > 0 then ST - (12 * INCREMENT)else Double.NaN;
PD12.SetDefaultColor(globalColor(“INCREMENT”));
PD12.HideTitle();
PD12.SetPaintingStrategy(PaintingStrategy.horizontal);
PD12.SetLineWeight(1);
plot MD13 = if showMidpoints then PD12 - MP else Double.NaN;
MD13.SetDefaultColor(globalColor(“INCREMENT”));
MD13.HideTitle();
MD13.SetPaintingStrategy(PaintingStrategy.dashes);
MD13.HideBubble();
MD13.SetLineWeight(1);
plot PD13 = if ST > 0 then ST - (13 * INCREMENT)else Double.NaN;
PD13.SetDefaultColor(globalColor(“INCREMENT”));
PD13.HideTitle();
PD13.SetPaintingStrategy(PaintingStrategy.horizontal);
PD13.SetLineWeight(1);
plot MD14 = if showMidpoints then PD13 - MP else Double.NaN;
MD14.SetDefaultColor(globalColor(“INCREMENT”));
MD14.HideTitle();
MD14.SetPaintingStrategy(PaintingStrategy.dashes);
MD14.HideBubble();
MD14.SetLineWeight(1);
plot PD14 = if ST > 0 then ST - (14 * INCREMENT)else Double.NaN;
PD14.SetDefaultColor(globalColor(“INCREMENT”));
PD14.HideTitle();
PD14.SetPaintingStrategy(PaintingStrategy.horizontal);
PD14.SetLineWeight(1);
plot MD15 = if showMidpoints then PD14 - MP else Double.NaN;
MD15.SetDefaultColor(globalColor(“INCREMENT”));
MD15.HideTitle();
MD15.SetPaintingStrategy(PaintingStrategy.dashes);
MD15.HideBubble();
MD15.SetLineWeight(1);
plot PD15 = if ST > 0 then ST - (15 * INCREMENT)else Double.NaN;
PD15.AssignValueColor (if(PD15/5)/round((PD15/5),0)==1 then CreateColor(192, 104, 222) else COLOR.LIGHT_GRAY);
PD15.HideTitle();
PD15.SetPaintingStrategy(PaintingStrategy.horizontal);
PD15.SetLineWeight(1);

#Vertical Line at minutes interval
#Sleepyz
input verticle_minutes1 = 5;
input verticle_minutes2 = 15;
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 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 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.long_dash);
 
@rlohmeyer, I also scalp at 2min charts. Thank you for this indicator. Can I just set it and use it, or do I need to actually change the settings per stock? What's the significance for the purple line at the bottom? Also, can you please explain how do you use @Townsend's multi time frame indicator for confirmation for entry, I don't understand that part.
 
@Steakeater
Since I generally use it for 1 particular stock for a number of days in a row, based on the high ranges the stock is getting. (I have a scan for determining which stocks to look at.) It needs to be set for each stock based on the Price Levels that you consider significant. For the one in the example, I set the primary increment at 1$ and the major level at $5, since this stock has been trading between 40 and 60 for a awhile. Your levels would be completely different for /ES or a stock trading in the hundreds.

Any other questions, let me know.

PS: In answer to your question, what is the significance of the Purple Line.....that shows a Major Level, which for this stock I consider to be at every Price Level divisible by 5. So 45,50,55..etc. This indicator also plots those for you based on your input for "Major".
 
Last edited:
@Steakeater
Sorry, did not answer your other questions. The Purple Line at $45 is considered a Major Price Level for this stock, as is every other price level divisible by 5, such as 35, 40, 50, 55, 60...etc. You can set this level also in the input section. I don't presently use the Townsend indicator since I can clearly see when the times occur that I am interested in based on my auto placed vertical lines. Entries for me are confirmed by a number of factors once a significant level is reached. Present and recent price action, volume profile, trend, nearness of other significant levels. The levels and times give you S/R and potential times for a "change" but not the entry, which is up to you. Since I trade the one minute for 90 minutes or so in the AM, I have to focus solely on the chart action, not on lower indicators that lag in any way.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
229 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top