Join useThinkScript to post your question to a community of 21,000+ developers and traders.
i don't know much about coding, how can a preference be added to this where you can add the time of the candle or make one like example the 720 period which is 12 hour, maybe like a drop-down to choose from, let me know and thanks for taking the time cheersSounds like you want something like this:
https://tlc.thinkorswim.com/center/...gationPeriod/AggregationPeriod-TWO-HOURS.html
I am seeking to obtain the open/close/high/low of the very first bar and to use this value as the starting point for a horizontal line. Any help or advice will be greatly appreciated.
# Draw horizontal line at market open price.
# Most code extracted from another study but forgot where.
# By Horserider.
input openingPMTime = 0400.0; #hint OrMeanS: Begin Mean Period. Usually Market Open EST.
input openingTime = 0930.0; #hint OrMeanS: Begin Mean Period. Usually Market Open EST.
def isDaily = If (GetAggregationPeriod() == AggregationPeriod.DAY, yes, no);
def isPreMarket = If (GetDay() == GetLastDay() and SecondsTillTime(openingPMTime) < 0, yes, no);
input LineWidth = 1;
def na = Double.NaN;
def isBelowDaily = If (GetAggregationPeriod() < AggregationPeriod.DAY, yes, no);
def isToday = If (GetDay() == GetLastDay() and SecondsFromTime(openingPMTime) >= 0, yes, no);
def day = GetDay();
def PMopenBar = day != day[1];
def PMOpen = if PMopenBar then open else PMOpen[1];
plot PlotPMOLine = if isToday and isBelowDaily then PMOpen else na;
PlotPMOLine.SetDefaultColor(CreateColor(77, 166, 255));
PlotPMOLine.SetLineWeight(LineWidth);
PlotPMOLine.SetPaintingStrategy(PaintingStrategy.DASHES);
PlotPMOLine.HideTitle();
PlotPMOLine.HideBubble();
Thanks for the rply, the chart is blank am i suppose to do something in the code ?See if this fits what you want. Let us know how you are using it please.
Code:# Draw horizontal line at market open price. # Most code extracted from another study but forgot where. # By Horserider. input openingPMTime = 0400.0; #hint OrMeanS: Begin Mean Period. Usually Market Open EST. input openingTime = 0930.0; #hint OrMeanS: Begin Mean Period. Usually Market Open EST. def isDaily = If (GetAggregationPeriod() == AggregationPeriod.DAY, yes, no); def isPreMarket = If (GetDay() == GetLastDay() and SecondsTillTime(openingPMTime) < 0, yes, no); input LineWidth = 1; def na = Double.NaN; def isBelowDaily = If (GetAggregationPeriod() < AggregationPeriod.DAY, yes, no); def isToday = If (GetDay() == GetLastDay() and SecondsFromTime(openingPMTime) >= 0, yes, no); def day = GetDay(); def PMopenBar = day != day[1]; def PMOpen = if PMopenBar then open else PMOpen[1]; plot PlotPMOLine = if isToday and isBelowDaily then PMOpen else na; PlotPMOLine.SetDefaultColor(CreateColor(77, 166, 255)); PlotPMOLine.SetLineWeight(LineWidth); PlotPMOLine.SetPaintingStrategy(PaintingStrategy.DASHES); PlotPMOLine.HideTitle(); PlotPMOLine.HideBubble();
Check Post 10 See if that helps.Is there a script to draw horiz line of high / low of 1st bar (after market open), it can be in any time frame.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Extending Opening Price | Questions | 0 | ||
K | Opening price horizontal plot | Questions | 3 | |
S | Anchoring comparison study to the opening price of the day | Questions | 4 | |
Z | labels for opening price, high of day, low of day, PM high, PM low | Questions | 2 | |
830am est opening price horizontal plot | Questions | 1 |
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.