Mr_Wheeler
Active member
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.
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
I got it....I guess its the daylines that i need to tweak..thank youYes, 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....
#@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();
# 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);
That's what I was looking for 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)
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();
HelloIn 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);
average daily range..Hello
What is the ADR , DR means please , Thanks for time and effort to explained everything .
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..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);
Where is the code for ADR? Would it be possible for you to share a grid with the latest code you are usinf?@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.
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.Where is the code for ADR? Would it be possible for you to share a grid with the latest code you are usinf?
Thank you very much for sending! Much appreciated!@Grroov @rfb
Here is the link to my present day_trade chart specifically for QQQ
http://tos.mx/Lf2wPPj
And here is what it looks like.....Remember, I do not trade a system or indicators, I trade price action at S/R...there is a large difference
Hi, can you please explain your chart please and I should look for price action.@Grroov @rfb
Here is the link to my present day_trade chart specifically for QQQ
http://tos.mx/Lf2wPPj
And here is what it looks like.....Remember, I do not trade a system or indicators, I trade price action at S/R...there is a large difference
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.@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
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.@rlohmeyer as you can see when premarket opens the script doesn't start plotting. This is PT time btw, I'm in CA
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.@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.
@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.
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);
Start a new thread and receive assistance from our community.
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.
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.