#Fifteen Minute OHLC
plot o = open(period = aggregationperiod.FIFTEEN_MIN)[1];
o.setpaintingstrategy(paintingstrategy.horizontal);
o.setdefaultcolor(color.orange);
plot h = high(period = aggregationperiod.FIFTEEN_MIN)[1];
h.setpaintingstrategy(paintingstrategy.horizontal);
h.setdefaultcolor(color.green);
plot l = low(period = aggregationperiod.FIFTEEN_MIN)[1];
l.setpaintingstrategy(paintingstrategy.horizontal);
l.setdefaultcolor(color.red);
plot c = close(period = aggregationperiod.FIFTEEN_MIN)[1];
c.setpaintingstrategy(paintingstrategy.horizontal);
c.setdefaultcolor(color.yellow);
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Hello Pensar, is it possible to get these lines to extend to the left and to the right over a 2 day period to include premarket and post market candle data, as well as to show the price values? Thanks.@Lees See if this works.
Code:#Fifteen Minute OHLC plot o = open(period = aggregationperiod.FIFTEEN_MIN)[1]; o.setpaintingstrategy(paintingstrategy.horizontal); o.setdefaultcolor(color.orange); plot h = high(period = aggregationperiod.FIFTEEN_MIN)[1]; h.setpaintingstrategy(paintingstrategy.horizontal); h.setdefaultcolor(color.green); plot l = low(period = aggregationperiod.FIFTEEN_MIN)[1]; l.setpaintingstrategy(paintingstrategy.horizontal); l.setdefaultcolor(color.red); plot c = close(period = aggregationperiod.FIFTEEN_MIN)[1]; c.setpaintingstrategy(paintingstrategy.horizontal); c.setdefaultcolor(color.yellow);
Welcome to the Forum, and Thanks. I'll check it out.i just joined and am looking for something similar in my last post, except for the daily time frame, not 15 min. I've got it so only the previous day has extended lines. if that's what you're looking for feel free to copy my code!
EDIT:
#
input aggregationPeriod = AggregationPeriod.day;
input length = 1;
input displace = -1;
input showLastPeriod = no;
plot PrevDayClose;
if showLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) { PrevDayClose = Double.NaN;
} else { PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
}
PrevDayClose.SetDefaultColor(GetColor(9));
PrevDayClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
i just found this while trying to fix my issue, hope this helps!
Hello Pensar, is it possible to get these lines to extend to the left and to the right over a 2 day period to include premarket and post market candle data, as well as to show the price values? Thanks.
See if this helps
Code:#Usethinkscript request - Prior Bar OHLC extended right and 2 days to the left with price displayed def lastbar = if IsNaN(close[-1]) and !IsNaN(close) then BarNumber() else Double.NaN; def dayCount = CompoundValue(1, if GetYYYYMMDD() != GetYYYYMMDD()[1] then dayCount[1] + 1 else dayCount[1], 0); def thisDay = (HighestAll(dayCount) - dayCount) ; input bars_back = 1; input days_displayed = 2; def v_priorbarclose = HighestAll(if BarNumber() == HighestAll(lastbar - bars_back) then close else Double.NaN); plot p_priorbarclose = if thisDay < days_displayed + 1 then v_priorbarclose else Double.NaN; AddChartBubble(BarNumber() == HighestAll(BarNumber()), p_priorbarclose, "C:" + Astext(v_priorbarclose), Color.WHITE); def v_priorbaropen = HighestAll(if BarNumber() == HighestAll(lastbar - bars_back) then open else Double.NaN); plot p_priorbaropen = if thisDay < days_displayed + 1 then v_priorbaropen else Double.NaN; AddChartBubble(BarNumber() == HighestAll(BarNumber()), p_priorbaropen, "O:" + Astext(v_priorbaropen), Color.WHITE); def v_priorbarhigh = HighestAll(if BarNumber() == HighestAll(lastbar - bars_back) then high else Double.NaN); plot p_priorbarhigh = if thisDay < days_displayed + 1 then v_priorbarhigh else Double.NaN; AddChartBubble(BarNumber() == HighestAll(BarNumber()), p_priorbarhigh, "H:" + Astext(v_priorbarhigh), Color.WHITE); def v_priorbarlow = HighestAll(if BarNumber() == HighestAll(lastbar - bars_back) then low else Double.NaN); plot p_priorbarlow = if thisDay < days_displayed + 1 then v_priorbarlow else Double.NaN; AddChartBubble(BarNumber() == HighestAll(BarNumber()), p_priorbarlow, "L:" + Astext(v_priorbarlow), Color.WHITE, no);
thanks for the welcome!Welcome to the Forum, and Thanks. I'll check it out.
Just to give to a head start, the attached link has some interesting resources. The link I got from this Forum.
https://onedrive.live.com/redir?resid=2FF733D1BA1E1E79!404&authkey=!ABOXXFyQg1iUqFk&page=View&wd=target(Welcome.one|a4f3f17e-e630-4d25-9b5b-ec957945a752/1. Introduction Usage (updated 02.13.|30461c4b-420e-4b83-b56f-55faf5d1461b/)
What would I need to add so once the most current OHLC are confirmed and moved ahead all the remaining past OHLC are not visible?Hello Pensar, is it possible to get these lines to extend to the left and to the right over a 2 day period to include premarket and post market candle data, as well as to show the price values? Thanks.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
R | Highlight Delta's on the chain | Questions | 4 | |
L | Highlight Studies on Hover and Incorrect Display of Study Colors | Questions | 1 | |
Highlight Trading Hours In ThinkOrSwim | Questions | 1 | ||
B | Highlight the newest stock in Watchlist column | Questions | 1 | |
P | Highlight three candles consecutively making higher lows | Questions | 5 |
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.