Color coding the e.g. 1h bar based on the e.g. average close of the 1 min bars within

pontenkin

New member
Hi,

I was wondering if anyone has come across a way to color code the e.g. 1h bar based on the e.g. average close price of the 1 min bars within it. For example let's say that, for the specific case above (1h chart), one defines

input length = 60;

def x = average(log(close/close[1]), length);

declare lower;
Plot y = if x > 0 then 1 else 0;

Something like this would work if I were to plot it on a 1 min indicator chart. What should I do if I actually intended to average the 60 close prices that fit within a 1 h bar and then plot it in a 1 h timeframe. This is sort of the opposite of displaying a higher time-frame on a lower time-frame chart.

I appreciate any help,

Thank you.
 

pontenkin

New member
Thank you for the reply. I believe I did not explain myself well. I do not wish to "display a lower timeframe data on a higher timeframe." Rather, I would like to retrieve, for example, the 1-minute closing prices contained in 1 hour (and there are 60 such closing prices in 1 hour,, perform some calculations on it, then assign a color for the 1 hour bar. It is a slightly different idea.
 

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.
Top