please help first 15 min candle

vince s

New member
can someone help me make a script that plots the high and low of the first 15 min candle with a 50% line and cloud that extends from open to next days close??


thank you in advance.
 
Solution
can someone help me make a script that plots the high and low of the first 15 min candle with a 50% line and cloud that extends from open to next days close??


thank you in advance.

Since you wanted to extend to the next day close, this required more logic than normal ORB.

Screenshot 2024-02-11 130534.png
Code:
input Lookback = 2;
input agg = AggregationPeriod.FIFTEEN_MIN;
input StartTime = 0930;
input EndTime   = 0945;

def startCounter5 = SecondsFromTime(StartTime);
def endCounter5 = SecondsTillTime(EndTime);
def range = if SecondsFromTime(StartTime) >= 0 and SecondsTillTime(EndTime) > 0 then 1 else 0;
def hper = high(period = agg);
def lper = low(period = agg);

def hrange = if range and !range[1]
             then hper
             else if...

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

can someone help me make a script that plots the high and low of the first 15 min candle with a 50% line and cloud that extends from open to next days close??


thank you in advance.

Since you wanted to extend to the next day close, this required more logic than normal ORB.

Screenshot 2024-02-11 130534.png
Code:
input Lookback = 2;
input agg = AggregationPeriod.FIFTEEN_MIN;
input StartTime = 0930;
input EndTime   = 0945;

def startCounter5 = SecondsFromTime(StartTime);
def endCounter5 = SecondsTillTime(EndTime);
def range = if SecondsFromTime(StartTime) >= 0 and SecondsTillTime(EndTime) > 0 then 1 else 0;
def hper = high(period = agg);
def lper = low(period = agg);

def hrange = if range and !range[1]
             then hper
             else if range
             then if hper > hrange[1]
                  then hper
                  else hrange[1]
             else hrange[1];

def lrange = if range and !range[1]
             then lper
             else if range
             then if lper < lrange[1]
                  then lper
                  else lrange[1]
             else lrange[1];

def ct  = if hrange[1] != hrange and lrange[1] != lrange then ct[1] + 1 else ct[1];
def cct = HighestAll(ct) - ct + 1;

def xH = if cct == Lookback then hrange else if cct <= Lookback - 1 and SecondsFromTime(1600) < 0 then xH[1] else Double.NaN;
plot H = if cct > Lookback + 1 then Double.NaN else xH;
H.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

def xL = if cct == Lookback then lrange else if cct <= Lookback - 1 and SecondsFromTime(1600) < 0 then xL[1] else Double.NaN;
plot L = xL;
L.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

plot M = (H + L) / 2;
M.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

input cloud = yes;
AddCloud(H, M, Color.GREEN, Color.GREEN);
AddCloud(M, L, Color.RED, Color.RED);
Screenshot 2024-02-11 130534.png
 
Last edited:
Solution

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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