Bottom rupture line

Mcanabal

Member
I want somebody collaboration to make a script that mark a horizontal line white in the bottom of the first bar in Hour, (including the wick if it have it just when it is green, if it is red just don't make any line and remains till closing the market 4 pm, then stop until next day, very much appreciated any help on this
 
Solution
Thanks buddy, but it is not working right, shows the white line randomly and not under the conditions mentioned

See if this helps

Screenshot-2022-12-24-080138.png
Code:
script hr {
input time  = 0400;
def cond    = if SecondsFromTime(time) == 0 and close>open
              then low
              else if secondstillTime(1600)>0
              then cond[1]
              else double.nan;
plot hour   = cond;
hour.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
}

plot hr4 = hr(400);
plot hr5 = hr(500);
plot hr6 = hr(600);
plot hr7 = hr(700);
plot hr8 = hr(800);
plot hr9 = hr(900);
plot hr10 = hr(1000);
plot hr11 = hr(1100);
plot hr12 = hr(1200);
plot hr13 = hr(1300);
plot hr14 = hr(1400);
plot hr15 = hr(1500)...
@Mcanabal
Ruby:
input starttime = 0400;
input endtime = 1600;
def Active = (SecondsFromTime(starttime) >= 0 and SecondsTillTime(endtime) > 0);
def hourly = if Active and (GetTime() % AggregationPeriod.HOUR == 0) and (close > open) then low else hourly[1];
plot hourlyplot = If Active then hourly else double.nan;
hourlyplot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
hourlyplot.SetDefaultColor(Color.WHITE);
 

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

Thanks buddy, but it is not working right, shows the white line randomly and not under the conditions mentioned

See if this helps

Screenshot-2022-12-24-080138.png
Code:
script hr {
input time  = 0400;
def cond    = if SecondsFromTime(time) == 0 and close>open
              then low
              else if secondstillTime(1600)>0
              then cond[1]
              else double.nan;
plot hour   = cond;
hour.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
}

plot hr4 = hr(400);
plot hr5 = hr(500);
plot hr6 = hr(600);
plot hr7 = hr(700);
plot hr8 = hr(800);
plot hr9 = hr(900);
plot hr10 = hr(1000);
plot hr11 = hr(1100);
plot hr12 = hr(1200);
plot hr13 = hr(1300);
plot hr14 = hr(1400);
plot hr15 = hr(1500);

hr4.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr5.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr6.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr7.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr8.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr9.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr10.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr11.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr12.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr13.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr14.setpaintingStrategy(paintingStrategy.HORIZONTAL);
hr15.setpaintingStrategy(paintingStrategy.HORIZONTAL);

defineglobalColor("HR", color.white);

hr4.setdefaultColor(globalColor("HR"));
hr5.setdefaultColor(globalColor("HR"));
hr6.setdefaultColor(globalColor("HR"));
hr7.setdefaultColor(globalColor("HR"));
hr8.setdefaultColor(globalColor("HR"));
hr9.setdefaultColor(globalColor("HR"));
hr10.setdefaultColor(globalColor("HR"));
hr11.setdefaultColor(globalColor("HR"));
hr12.setdefaultColor(globalColor("HR"));
hr13.setdefaultColor(globalColor("HR"));
hr14.setdefaultColor(globalColor("HR"));
hr15.setdefaultColor(globalColor("HR"));

input lineweight = 1;

hr4.setlineWeight(lineweight);
hr5.setlineWeight(lineweight);
hr6.setlineWeight(lineweight);
hr7.setlineWeight(lineweight);
hr8.setlineWeight(lineweight);
hr9.setlineWeight(lineweight);
hr10.setlineWeight(lineweight);
hr11.setlineWeight(lineweight);
hr12.setlineWeight(lineweight);
hr13.setlineWeight(lineweight);
hr14.setlineWeight(lineweight);
hr15.setlineWeight(lineweight);
 
Solution
Thanks buddy but sometimes one image tells more than thousand words, let me try to explain once again what I need:
When the first bar in the morning (10 AM) is green start drawing a white line until market closes (4 pm), and then stop drawing, if the firs bar at opening is red (do nothing).........

Please see picture below....

https://imagizer.imageshack.com/img922/748/EZA52E.png
So delete all the plots you do not want. It would have been easier if you would have specified that you wanted just one bar that you just made in thiis post.
 
https://imagizer.imageshack.com/img922/4594/fkqq5Q.png

The doted line just ignore it this is the price line, is the white line when condition are met, (first green bar), till 4 pm show, otherwise (I mean when it is red) , not drawing at all

I unchecked all of the plots except hr10 as that is what you last requested. Otherwise there are not any changes to the script I posted above.

Note that only the green bars at 1000 on any day do not have a line drawn under the 1000 bar on the image below.

This is a share link to the script in the image below. http://tos.mx/NssOBfv

 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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