How to make the opening 6 histogram bars a different color from the rest of the day?

bettyjeanbell

New member
Hi. I cannot figure out how to create a solution. Would GREATLY appreciate your help.

I created a simple volume indicator for my chart to watch some market internal metrics. I'm trying to get the first 6 bars of this volume chart to be a different color from the rest of the bars in the chart. Basically, I want the volume bars in the first 30 minutes of market open to be a separate color form the volume bars the rest of the day.

However, I'm not attached to the bars themselves being a color. I'm open to simply shading the background of this indicator during the first 30 minutes of market open.

I've attempted the above without success. I've also attempted drawing a vertical line 30 minutes into market open without succss.

I think the code I'm struggling with is time based code, making something happen just in that first 30 minutes of market open. All my attempts have failed. Any guidance or code to solve this problem or point me in a correct direction would be apprecaited.

Including a google drive link to a screenshot of the chart with the indicator I've coded. Have drawn a yellow box around the 6 candles I want to change the colors on every day. https://drive.google.com/file/d/1uYcfh6gosC2OQ_P2s9-39PusdhoMu4Zu/view?usp=sharing

Thank you SO MUCH in advance for your help :)

Best,
Betty Jean
 
Solution
Hi. I cannot figure out how to create a solution. Would GREATLY appreciate your help.

I created a simple volume indicator for my chart to watch some market internal metrics. I'm trying to get the first 6 bars of this volume chart to be a different color from the rest of the bars in the chart. Basically, I want the volume bars in the first 30 minutes of market open to be a separate color form the volume bars the rest of the day.

However, I'm not attached to the bars themselves being a color. I'm open to simply shading the background of this indicator during the first 30 minutes of market open.

I've attempted the above without success. I've also attempted drawing a vertical line 30 minutes into market open without succss.

I think...
Hi. I cannot figure out how to create a solution. Would GREATLY appreciate your help.

I created a simple volume indicator for my chart to watch some market internal metrics. I'm trying to get the first 6 bars of this volume chart to be a different color from the rest of the bars in the chart. Basically, I want the volume bars in the first 30 minutes of market open to be a separate color form the volume bars the rest of the day.

However, I'm not attached to the bars themselves being a color. I'm open to simply shading the background of this indicator during the first 30 minutes of market open.

I've attempted the above without success. I've also attempted drawing a vertical line 30 minutes into market open without succss.

I think the code I'm struggling with is time based code, making something happen just in that first 30 minutes of market open. All my attempts have failed. Any guidance or code to solve this problem or point me in a correct direction would be apprecaited.

Including a google drive link to a screenshot of the chart with the indicator I've coded. Have drawn a yellow box around the 6 candles I want to change the colors on every day. https://drive.google.com/file/d/1uYcfh6gosC2OQ_P2s9-39PusdhoMu4Zu/view?usp=sharing

Thank you SO MUCH in advance for your help :)

Best,
Betty Jean

This should help

snip.jpg
Ruby:
def range = secondsFromTime(0930)>=0 and secondsFromTime(1000)<0;
plot volr = if range then volume else double.nan;
volr.setdefaultColor(color.white);
volr.setpaintingStrategy(paintingStrategy.HISTOGRAM);
 
Solution

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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