• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

thinkScript Price Level Drawn on Chart

vince92615

New member
VIP
How to make this following simple script?
  • past 10 days daily open/close price level ( Including daily highest and lowest ) So total 4 price lines for each day
I am having little bit hard time to keep drawing those price levels on all my watchlist and deleted the price level that more than 10 days. I will there is a simply study be able to help me
 

YungTraderFromMontana

Well-known member
Here
Code:
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLast10Period = yes;

plot DailyHigh;
plot DailyLow;
plot DailyOpen;
plot DailyClose;
if showOnlyLast10Period and !IsNaN(close(period = aggregationPeriod)[-10]) {
    DailyHigh = Double.NaN;
    DailyLow = Double.NaN;
    DailyOpen = Double.NaN;
    DailyClose = Double.NaN;
} else {
    DailyHigh = Highest(high(period = aggregationPeriod)[-displace], length);
    DailyLow = Lowest(low(period = aggregationPeriod)[-displace], length);
    DailyOpen = Highest(Open(period = aggregationPeriod)[-displace], length);
    DailyClose = Lowest(Close(period = aggregationPeriod)[-displace], length);
}

DailyHigh.SetDefaultColor(GetColor(4));
DailyHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyLow.SetDefaultColor(GetColor(4));
DailyLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyClose.SetDefaultColor(GetColor(4));
DailyClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
DailyOpen.SetDefaultColor(GetColor(4));
DailyOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
 

vince92615

New member
VIP
@YungTraderFromMontana Thank you so much. Here is something a little bit different showed on my chart

-Price lines should be extended all the way to the right. (so should be total 40 price lines all the time to the right)
daily open, close, daily high, low * 10

-delete the 4 price line (daily open/close, daily high/low) from day 1 starting on day 11. so always keep the nearest 10-days prices line all time


So it there anyway you can help me update this? I would really appreciate it
 

BenTen

Administrative
Staff
VIP
@vince92615 Only the most current lines can be extended all the way to the right. In this case, there should only be 4.

Edit: Since this is being plotted on a day to day basis, they won't be extended all the way. The lines will stop before the next trading period.
 

vince92615

New member
VIP
@vince92615 Only the most current lines can be extended all the way to the right. In this case, there should only be 4.

Edit: Since this is being plotted on a day to day basis, they won't be extended all the way. The lines will stop before the next trading period.

but is it possible at least show 10 days ?
when i plug in this study and, most the price line only show for 1 day when i open 6mo/ 1d timeframe
 

vince92615

New member
VIP
You know when you manually click the price line drawing on TOS, click the price point and it will automatically have price line drawing all the way to the right with the price. Basically I need something exactly like that instead manually drawing on each ticker and deleting the old one. So When I start my today trading, it will show past 10 days open, close, high and low level.

Yellow price line was by this study. But I was hoping something like the price level I manually did at the bottom of the pic. So while opening the different timeframe I was able to see past couples day open/close and high low price level

zlTZtcl.png
 

Similar threads

Top