Auto Significant Price Levels for ThinkorSwim

Yes instead of price based Horizontal lines, can you make time based Horizontal lines..
Yes, of course, but that is not the purpose of the PriceTimeGrid There are illustrations of these on the above chart where I have an indicator I call DayLines to auto draw the Open as a horizontal line, Yesterday's close, todays High and Low and Yesterday's High and Low. I also draw previous days' VWAP endings and previous days' POCs ending as potential S/R....
 

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

What does MD4, PD4, MD4,PLS,MU, represent? What does the "PLI" input change? I would have that information placed in the original post as well.
 
Yes, of course, but that is not the purpose of the PriceTimeGrid There are illustrations of these on the above chart where I have an indicator I call DayLines to auto draw the Open as a horizontal line, Yesterday's close, todays High and Low and Yesterday's High and Low. I also draw previous days' VWAP endings and previous days' POCs ending as potential S/R....
I got it....I guess its the daylines that i need to tweak..thank you
 
@Grroov
Below is the code I presently use for DayLines indicator and an image on a 15 min chart of QQQ
1. Days Open are the Yellow Points
2. Yesterdays Close are the Orange Sqaures
3. The Days High are Green Points which change to Green Squares on the next day, marking Yesterdays High
4. The Days Low are Red Points which change to Red Squares on the next day, marking Yesterdays Low
All can be important Targets for Price and S/R for price action

The Bright Magenta Rectangles forming a Line on the Chart is the VWAP line, also an important potential Target and S/R Line

The Solid Colored Lines on the Chart are EMA's, (Exponential Moving Averages) for the Day Time Frame, these can also be significant S/R...as you can clearly see on Friday's Chart because 2 of these were clearly rejected twice before price began to move lower with a vengeance (marked this with an arrow)
5m1wfGd.jpg


Code:
#@rlohmeyer_Lines
#def tradeStartEST = 0930;
#def tradeEndEST = 1559;
#def inPeriod = if SecondsTillTime(tradeStartEST) <= 0 and SecondsTillTime(tradeEndEST) > 0 then 1 else 0;



def AP = aggregationPeriod.day;
input plotlevels = yes;


plot D_Open = if plotlevels then open(period = AP)else double.NaN;
D_Open.SetDefaultColor(CreateColor(209, 255, 3));
D_Open.SetPaintingStrategy(PaintingStrategy.points);
D_Open.SetLineWeight(2);
D_Open.HideTitle();

plot Y_Close = if plotlevels then close(period =AP)[1] else double.NaN;
Y_Close.SetPaintingStrategy(PaintingStrategy.squares);
Y_Close.SetDefaultColor(Color.DARK_ORANGE);
Y_Close.SetLineWeight(2);
Y_Close.HideTitle();
Y_Close.HideBubble();

plot D_High = if plotlevels then high(period = AP) else double.NaN;
D_High.SetDefaultColor(Color.Green);
D_High.SetPaintingStrategy(PaintingStrategy.points);
D_High.SetLineWeight(2);
D_High.HideTitle();
D_High.HideBubble();

plot D_Low = if plotlevels then low(period = AP)else double.NaN;
D_Low.SetDefaultColor(Color.RED);
D_Low.SetPaintingStrategy(PaintingStrategy.points);
D_Low.SetLineWeight(2);
D_Low.HideTitle();
D_Low.HideBubble();

plot Y_High = if plotlevels then high(period = AP)[1] else double.NaN;
Y_High.SetDefaultColor(Color.GREEN);
Y_High.SetPaintingStrategy(PaintingStrategy.squares);
Y_High.SetLineWeight(2);
Y_High.HideTitle();
Y_High.HideBubble();

plot Y_Low = if plotlevels then Low(period = AP)[1] else double.NaN;
Y_Low.SetDefaultColor(Color.RED);
Y_Low.SetPaintingStrategy(PaintingStrategy.squares);
Y_Low.SetLineWeight(2);
Y_Low.HideTitle();
Y_Low.HideBubble();
 
@Mr_Wheeler

All of these are the Plotted Lines...The PLI is the main Price Level Increment to be used. Good suggestion, however, I only have so much time to devote to this coding site, so I try to respond to new posts with updated code and answer questions. In that way, anyone following this who has questions can get any updated code I am presently using. I don't tend to post full setups of present charts, as each person's journey to profitability or realization that trading is not for them is different.

Regards,
Bob
 
In Post 104 I mentioned Exponential Moving Averages I use on my charts all calculated for the Day Time Frame. This can be an exceptionally useful indicator on lower time frame charts, as shown in Post 104 when two 15 minute bars rejected 2 EMAs spaced closely together. Here is the code for that indicator that I presently use on all my intraday charts.

Code:
# MTF Moving Average
#@rlohmeyer
def AT1 = averageType.EXPONENTIAL;
def L1P = aggregationPeriod.DAY;
def L1 = 5;
def AT2 = averageType.EXPONENTIAL;
def L2P = aggregationPeriod.DAY;
def L2 = 10;
def AT3 = averageType.EXPONENTIAL;
def L3P = aggregationPeriod.DAY;
def L3 = 20;
def AT4 = averageType.EXPONENTIAL;
def L4P = aggregationPeriod.DAY;
def L4 = 50;
def AT5 = averageType.EXPONENTIAL;
def L5P = aggregationPeriod.DAY;
def L5 = 100;
def AT6 = averageType.EXPONENTIAL;
def L6P = aggregationPeriod.DAY;
def L6 = 200;

plot AVG1 = MovingAverage(AT1, close(period = L1P)[1], L1);
AVG1.setdefaultcolor(color.yellow);
AVG1.hidebubble();
AVG1.hidetitle();
Avg1.setlineWeight(2);
plot AVG2 = MovingAverage(AT2, close(period = L2P)[1], L2);
AVG2.SetDefaultColor(CreateColor(255,204,0));
AVG2.hidebubble();
AVG2.hidetitle();
Avg2.setlineWeight(2);
plot AVG3 = MovingAverage(AT3, close(period = L3P)[1], L3);
AVG3.SetDefaultColor(CreateColor(255, 153, 0));
AVG3.hidebubble();
AVG3.hidetitle();
Avg3.setlineWeight(2);
plot AVG4 = MovingAverage(AT4, close(period = L4P)[1], L4);
AVG4.SetDefaultColor(CreateColor(255, 102, 0));
AVG4.hidebubble();
AVG4.hidetitle();
Avg4.setlineWeight(2);
plot AVG5 = MovingAverage(AT5, close(period = L5P)[1], L5);
AVG5.SetDefaultColor(CreateColor(255, 51, 0));
AVG5.hidebubble();
AVG5.hidetitle();
Avg5.setlineWeight(2);
plot AVG6 = MovingAverage(AT6, close(period = L6P)[1], L6);
AVG6.SetDefaultColor(color.red);
AVG6.hidebubble();
AVG6.hidetitle();
Avg6.setlineWeight(2);
 
@Grroov
Below is the code I presently use for DayLines indicator and an image on a 15 min chart of QQQ
1. Days Open are the Yellow Points
2. Yesterdays Close are the Orange Sqaures
3. The Days High are Green Points which change to Green Squares on the next day, marking Yesterdays High
4. The Days Low are Red Points which change to Red Squares on the next day, marking Yesterdays Low
All can be important Targets for Price and S/R for price action

The Bright Magenta Rectangles forming a Line on the Chart is the VWAP line, also an important potential Target and S/R Line

The Solid Colored Lines on the Chart are EMA's, (Exponential Moving Averages) for the Day Time Frame, these can also be significant S/R...as you can clearly see on Friday's Chart because 2 of these were clearly rejected twice before price began to move lower with a vengeance (marked this with an arrow)
5m1wfGd.jpg


Code:
#@rlohmeyer_Lines
#def tradeStartEST = 0930;
#def tradeEndEST = 1559;
#def inPeriod = if SecondsTillTime(tradeStartEST) <= 0 and SecondsTillTime(tradeEndEST) > 0 then 1 else 0;



def AP = aggregationPeriod.day;
input plotlevels = yes;


plot D_Open = if plotlevels then open(period = AP)else double.NaN;
D_Open.SetDefaultColor(CreateColor(209, 255, 3));
D_Open.SetPaintingStrategy(PaintingStrategy.points);
D_Open.SetLineWeight(2);
D_Open.HideTitle();

plot Y_Close = if plotlevels then close(period =AP)[1] else double.NaN;
Y_Close.SetPaintingStrategy(PaintingStrategy.squares);
Y_Close.SetDefaultColor(Color.DARK_ORANGE);
Y_Close.SetLineWeight(2);
Y_Close.HideTitle();
Y_Close.HideBubble();

plot D_High = if plotlevels then high(period = AP) else double.NaN;
D_High.SetDefaultColor(Color.Green);
D_High.SetPaintingStrategy(PaintingStrategy.points);
D_High.SetLineWeight(2);
D_High.HideTitle();
D_High.HideBubble();

plot D_Low = if plotlevels then low(period = AP)else double.NaN;
D_Low.SetDefaultColor(Color.RED);
D_Low.SetPaintingStrategy(PaintingStrategy.points);
D_Low.SetLineWeight(2);
D_Low.HideTitle();
D_Low.HideBubble();

plot Y_High = if plotlevels then high(period = AP)[1] else double.NaN;
Y_High.SetDefaultColor(Color.GREEN);
Y_High.SetPaintingStrategy(PaintingStrategy.squares);
Y_High.SetLineWeight(2);
Y_High.HideTitle();
Y_High.HideBubble();

plot Y_Low = if plotlevels then Low(period = AP)[1] else double.NaN;
Y_Low.SetDefaultColor(Color.RED);
Y_Low.SetPaintingStrategy(PaintingStrategy.squares);
Y_Low.SetLineWeight(2);
Y_Low.HideTitle();
Y_Low.HideBubble();
That's what I was looking for thank you
 
In Post 104 I mentioned Exponential Moving Averages I use on my charts all calculated for the Day Time Frame. This can be an exceptionally useful indicator on lower time frame charts, as shown in Post 104 when two 15 minute bars rejected 2 EMAs spaced closely together. Here is the code for that indicator that I presently use on all my intraday charts.

Code:
# MTF Moving Average
#@rlohmeyer
def AT1 = averageType.EXPONENTIAL;
def L1P = aggregationPeriod.DAY;
def L1 = 5;
def AT2 = averageType.EXPONENTIAL;
def L2P = aggregationPeriod.DAY;
def L2 = 10;
def AT3 = averageType.EXPONENTIAL;
def L3P = aggregationPeriod.DAY;
def L3 = 20;
def AT4 = averageType.EXPONENTIAL;
def L4P = aggregationPeriod.DAY;
def L4 = 50;
def AT5 = averageType.EXPONENTIAL;
def L5P = aggregationPeriod.DAY;
def L5 = 100;
def AT6 = averageType.EXPONENTIAL;
def L6P = aggregationPeriod.DAY;
def L6 = 200;

plot AVG1 = MovingAverage(AT1, close(period = L1P)[1], L1);
AVG1.setdefaultcolor(color.yellow);
AVG1.hidebubble();
AVG1.hidetitle();
Avg1.setlineWeight(2);
plot AVG2 = MovingAverage(AT2, close(period = L2P)[1], L2);
AVG2.SetDefaultColor(CreateColor(255,204,0));
AVG2.hidebubble();
AVG2.hidetitle();
Avg2.setlineWeight(2);
plot AVG3 = MovingAverage(AT3, close(period = L3P)[1], L3);
AVG3.SetDefaultColor(CreateColor(255, 153, 0));
AVG3.hidebubble();
AVG3.hidetitle();
Avg3.setlineWeight(2);
plot AVG4 = MovingAverage(AT4, close(period = L4P)[1], L4);
AVG4.SetDefaultColor(CreateColor(255, 102, 0));
AVG4.hidebubble();
AVG4.hidetitle();
Avg4.setlineWeight(2);
plot AVG5 = MovingAverage(AT5, close(period = L5P)[1], L5);
AVG5.SetDefaultColor(CreateColor(255, 51, 0));
AVG5.hidebubble();
AVG5.hidetitle();
Avg5.setlineWeight(2);
plot AVG6 = MovingAverage(AT6, close(period = L6P)[1], L6);
AVG6.SetDefaultColor(color.red);
AVG6.hidebubble();
AVG6.hidetitle();
Avg6.setlineWeight(2);
Hello
What is the ADR , DR means please , Thanks for time and effort to explained everything .
 
In Post 104 I mentioned Exponential Moving Averages I use on my charts all calculated for the Day Time Frame. This can be an exceptionally useful indicator on lower time frame charts, as shown in Post 104 when two 15 minute bars rejected 2 EMAs spaced closely together. Here is the code for that indicator that I presently use on all my intraday charts.

Code:
# MTF Moving Average
#@rlohmeyer
def AT1 = averageType.EXPONENTIAL;
def L1P = aggregationPeriod.DAY;
def L1 = 5;
def AT2 = averageType.EXPONENTIAL;
def L2P = aggregationPeriod.DAY;
def L2 = 10;
def AT3 = averageType.EXPONENTIAL;
def L3P = aggregationPeriod.DAY;
def L3 = 20;
def AT4 = averageType.EXPONENTIAL;
def L4P = aggregationPeriod.DAY;
def L4 = 50;
def AT5 = averageType.EXPONENTIAL;
def L5P = aggregationPeriod.DAY;
def L5 = 100;
def AT6 = averageType.EXPONENTIAL;
def L6P = aggregationPeriod.DAY;
def L6 = 200;

plot AVG1 = MovingAverage(AT1, close(period = L1P)[1], L1);
AVG1.setdefaultcolor(color.yellow);
AVG1.hidebubble();
AVG1.hidetitle();
Avg1.setlineWeight(2);
plot AVG2 = MovingAverage(AT2, close(period = L2P)[1], L2);
AVG2.SetDefaultColor(CreateColor(255,204,0));
AVG2.hidebubble();
AVG2.hidetitle();
Avg2.setlineWeight(2);
plot AVG3 = MovingAverage(AT3, close(period = L3P)[1], L3);
AVG3.SetDefaultColor(CreateColor(255, 153, 0));
AVG3.hidebubble();
AVG3.hidetitle();
Avg3.setlineWeight(2);
plot AVG4 = MovingAverage(AT4, close(period = L4P)[1], L4);
AVG4.SetDefaultColor(CreateColor(255, 102, 0));
AVG4.hidebubble();
AVG4.hidetitle();
Avg4.setlineWeight(2);
plot AVG5 = MovingAverage(AT5, close(period = L5P)[1], L5);
AVG5.SetDefaultColor(CreateColor(255, 51, 0));
AVG5.hidebubble();
AVG5.hidetitle();
Avg5.setlineWeight(2);
plot AVG6 = MovingAverage(AT6, close(period = L6P)[1], L6);
AVG6.SetDefaultColor(color.red);
AVG6.hidebubble();
AVG6.hidetitle();
Avg6.setlineWeight(2);
Have you tried adding slow stochastic or zscore as an upper indicator.. it acts as a good reversal signal off of a major daily lines..
 
@grrove

Looked at many and coded a number....do best with price action near the S/R that I have found significant....

@Peace2019

Grrove is correct: Average Daily Range which is based on a 5 Period EMA and the DR which is todays range so I can see at a glance what kind of day we could have.
 
@grrove

Looked at many and coded a number....do best with price action near the S/R that I have found significant....

@Peace2019

Grrove is correct: Average Daily Range which is based on a 5 Period EMA and the DR which is todays range so I can see at a glance what kind of day we could have.
Where is the code for ADR? Would it be possible for you to share a grid with the latest code you are usinf?
 
  • Like
Reactions: rfb
Where is the code for ADR? Would it be possible for you to share a grid with the latest code you are usinf?
Thanks for asking that. I asked earlier as well. I think it would it make things quite a bit easier to see how a grid is put together then adjust as necessary to one's individual instrument, timeline and style. Just trying to get a feel for the charting aspects of this. Thanks in advance if you can Bob.
 
Hi Bob
@kckilla

I have looked at the premarket for the PriceTimeGrid and the Price Lines display premarket. Are you talking about the Vertical Time Lines specifically?

Bob
Hi Bob, hope you're having a great weekend. I'm using the Auto Price Levels with horizontal lines only. The code would display previous day's premarket lines but won't paint new premarket lines until market open. Below is the one I'm using. I will screenshot tomorrow premarket session so you can see what I'm talking about.

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

DefineGlobalColor("PLI",color.dark_gray);
DefineGlobalColor("MP",color.dark_gray);
def op = open(period = AggregationPeriod.day);
def ST = Round(op, 0);
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);
 
@rlohmeyer as you can see when premarket opens the script doesn't start plotting. This is PT time btw, I'm in CA

bHdo2wT.jpg
This may be a result of hard coding to define the when the market opens, and could possibly be changed with coding to define a new "when" the market opens, however, I do not at present have time to look at this and figure it out. Others more expert with coding on the forum may be able to modify the code much more easily than I to give you what you want.

Regards,
Bob
 
@Thomas Thanks for the nifty code from post #12 and the suggestion about 2 minute bars, which did help reduce the noise level. The above chart is showing 2 minute bars.

Since I use a 3 bar Volume POC on my trading chart, I use this as a reference point. These high volume nodes often turn out to be close to a pullback area before continuation of a move. It forms a pattern confirming continuation of a move based on actual high volume nodes. Here is an image with the magenta lines being the high volume nodes. I use these in concert with the Price Levels, as stated elsewhere.
EVH5gYn.jpg


@tradeidea20

I have improved the code for AutoPriceLevels. It now does several things automatically based on the choice of options. The improved code is below.
yLtYiEb.jpg


If you choose to set your own start level price because the stock has gapped in overnight trade, you would choose "yes" for the "gap start" option and a specific round number price level for the "gaplevel" start. The gaplevel start price will show on the chart as a solid orange line, and 8 price levels will populate BOTH ABOVE AND BELOW THAT LEVEL along with midpoints if the "show midpoints" option is "yes".

However, if you choose "no" for the "gap start" option then the code locates the previous day nearest round number close price (regular trading session) and sets that price level as the first Price Level, shown in Orange. It then does the same thing as a above, populates 8 Price Levels above and below.

I am hoping this makes this indicator easier to use. On my chart above I have reduced my background grid so that it does not show so that I can clearly see the major levels.

Code:
#Auto Price Levels
#@rlohmeyer shared on UseThinkscript
input gapStart = no;
input gaplevel = 00;
input PLI = 1.00;
input showMidpoints = yes;

DefineGlobalColor("PLI",color.white);
DefineGlobalColor("MP",color.light_gray);
def cl = close(period = AggregationPeriod.DAY);
def ST = Round(cl[1], 0);
def START = if gapstart == 0 then ST else if gapstart == 1 then gaplevel else Double.NaN;
def MP = PLI/2;

#Plot START
plot PLS = START;
PLS.SetDefaultColor(color.orange);
PLS.HideTitle();
PLS.SetPaintingStrategy(PaintingStrategy.horizontal);

#START Up
plot MUS = if showMidpoints then START + MP else Double.NaN;
MUS.SetDefaultColor(globalColor("MP"));
MUS.HideTitle();
MUS.SetPaintingStrategy(PaintingStrategy.dashes);
MUS.HideBubble();
plot P2 = if START > 0 then START + PLI else Double.NaN;
P2.SetDefaultColor(globalColor("PLI"));
P2.HideTitle();
P2.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M2 = if showMidpoints then P2 + MP else Double.NaN;
M2.SetDefaultColor(globalColor("MP"));
M2.HideTitle();
M2.SetPaintingStrategy(PaintingStrategy.dashes);
M2.HideBubble();
plot P3 = if START > 0 then START + (2 * PLI)else Double.NaN;
P3.SetDefaultColor(globalColor("PLI"));
P3.HideTitle();
P3.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M3 = if showMidpoints then P3 +  MP else Double.NaN;
M3.SetDefaultColor(globalColor("MP"));
M3.HideTitle();
M3.SetPaintingStrategy(PaintingStrategy.dashes);
M3.HideBubble();
plot P4 = if START > 0 then START + (3 * PLI)else Double.NaN;
P4.SetDefaultColor(globalColor("PLI"));
P4.HideTitle();
P4.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M4 = if showMidpoints then P4 + MP else Double.NaN;
M4.SetDefaultColor(globalColor("MP"));
M4.HideTitle();
M4.SetPaintingStrategy(PaintingStrategy.dashes);
M4.HideBubble();
plot P5 = if START > 0 then START + (4 * PLI)else Double.NaN;
P5.SetDefaultColor(globalColor("PLI"));
P5.HideTitle();
P5.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M5 = if showMidpoints then P5 + MP else Double.NaN;
M5.SetDefaultColor(globalColor("MP"));
M5.HideTitle();
M5.SetPaintingStrategy(PaintingStrategy.dashes);
M5.HideBubble();
plot P6 = if START > 0 then START + (5 * PLI)else Double.NaN;
P6.SetDefaultColor(globalColor("PLI"));
P6.HideTitle();
P6.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M6 = if showMidpoints then P6 + MP else Double.NaN;
M6.SetDefaultColor(globalColor("MP"));
M6.HideTitle();
M6.SetPaintingStrategy(PaintingStrategy.dashes);
M6.HideBubble();
plot P7 = if START > 0 then START + (6 * PLI)else Double.NaN;
P7.SetDefaultColor(globalColor("PLI"));
P7.HideTitle();
P7.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M7 = if showMidpoints then P7 + MP else Double.NaN;
M7.SetDefaultColor(globalColor("MP"));
M7.HideTitle();
M7.SetPaintingStrategy(PaintingStrategy.dashes);
M7.HideBubble();
plot P8 = if START > 0 then START + (7 * PLI)else Double.NaN;
P8.SetDefaultColor(globalColor("PLI"));
P8.HideTitle();
P8.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M8 = if showMidpoints then P8 + MP else Double.NaN;
M8.SetDefaultColor(globalColor("MP"));
M8.HideTitle();
M8.SetPaintingStrategy(PaintingStrategy.dashes);
M8.HideBubble(); 
plot P9 = if START > 0 then START + (8 * PLI)else Double.NaN;
P9.SetDefaultColor(globalColor("PLI"));
P9.HideTitle();
P9.SetPaintingStrategy(PaintingStrategy.horizontal);

#STARTDown
plot MUD = if showMidpoints then START - MP else Double.NaN;
MUD.SetDefaultColor(globalColor("MP"));
MUD.HideTitle();
MUD.SetPaintingStrategy(PaintingStrategy.dashes);
MUD.HideBubble();
plot P10 = if START > 0 then START - PLI else Double.NaN;
P10.SetDefaultColor(globalColor("PLI"));
P10.HideTitle();
P10.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M10 = if showMidpoints then P10 - MP else Double.NaN;
M10.SetDefaultColor(globalColor("MP"));
M10.HideTitle();
M10.SetPaintingStrategy(PaintingStrategy.dashes);
M10.HideBubble();
plot P11 = if START > 0 then START - (2 * PLI) else Double.NaN;
P11.SetDefaultColor(globalColor("PLI"));
P11.HideTitle();
P11.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M11 = if showMidpoints then P11 - MP else Double.NaN;
M11.SetDefaultColor(globalColor("MP"));
M11.HideTitle();
M11.SetPaintingStrategy(PaintingStrategy.dashes);
M11.HideBubble();
plot P12 = if START > 0 then START - (3 * PLI)else Double.NaN;
P12.SetDefaultColor(globalColor("PLI"));
P12.HideTitle();
P12.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M12 = if showMidpoints then P12 - MP else Double.NaN;
M12.SetDefaultColor(globalColor("MP"));
M12.HideTitle();
M12.SetPaintingStrategy(PaintingStrategy.dashes);
M12.HideBubble();
plot P13 = if START > 0 then START - (4 * PLI)else Double.NaN;
P13.SetDefaultColor(globalColor("PLI"));
P13.HideTitle();
P13.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M13 = if showMidpoints then P13 - MP else Double.NaN;
M13.SetDefaultColor(globalColor("MP"));
M13.HideTitle();
M13.SetPaintingStrategy(PaintingStrategy.dashes);
M13.HideBubble();
plot P14 = if START > 0 then START - (5 * PLI)else Double.NaN;
P14.SetDefaultColor(globalColor("PLI"));
P14.HideTitle();
P14.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M14 = if showMidpoints then P14 - MP else Double.NaN;
M14.SetDefaultColor(globalColor("MP"));
M14.HideTitle();
M14.SetPaintingStrategy(PaintingStrategy.dashes);
M14.HideBubble();
plot P15 = if START > 0 then START - (6 * PLI)else Double.NaN;
P15.SetDefaultColor(globalColor("PLI"));
P15.HideTitle();
P15.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M15 = if showMidpoints then P15 - MP else Double.NaN;
M15.SetDefaultColor(globalColor("MP"));
M15.HideTitle();
M15.SetPaintingStrategy(PaintingStrategy.dashes);
M15.HideBubble();
plot P16 = if START > 0 then START - (7 * PLI)else Double.NaN;
P16.SetDefaultColor(globalColor("PLI"));
P16.HideTitle();
P16.SetPaintingStrategy(PaintingStrategy.horizontal);
plot M16 = if showMidpoints then P16 - MP else Double.NaN;
M16.SetDefaultColor(globalColor("MP"));
M16.HideTitle();
M16.SetPaintingStrategy(PaintingStrategy.dashes);
M16.HideBubble();
plot P17 = if START > 0 then START - (8 * PLI)else Double.NaN;
P17.SetDefaultColor(globalColor("PLI"));
P17.HideTitle();
P17.SetPaintingStrategy(PaintingStrategy.horizontal);
What are the magenta indicators you use for volume that you state? I am confused if it’s in the code for the levels you posted.

Thanks for the help!
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
262 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