Heikin Ashi Chart Plots

madeinnyc

Member
I'm trying to find something to plot the low/high of new candles in the opposite trend on Heikin Ashi style charts. So if candle turns from red to green (or vice-versa), the indicator can plot the high and low of that new candle....just on the first candle of a new direction. I'm not finding anything on TOS and wondered if perhaps it's already created on this group? I tried searching for it, but no luck finding it.
 
Glad to be of help @madeinnyc . If you had it under Studies instead of Strategies , no worries - it is a mistake I have made before as well :giggle: . The wise one BenTen told me an easy way to tell is that if it has AddOrder in it then it goes in the Strategy tab (y). Since then I do a quick glance through any new script I test to see if it contains AddOrder.

When you get the new code done for what you are planning to do will you consider sharing it please? It sounds interesting and I would like to give it a try.
 
This one shows you where the price closed on Heikin Ashi and the color indicates if the price closes above (green), below(red) or inside (gray)

Code:
# sdi_closeLevel
plot cl = close;
cl.setpaintingStrategy(PaintingStrategy.HORIZONTAL);
#hint: plot the close level as a horizontal line with the color determined by its relationship to the heiken-ashi body.
cl.defineColor("above h-a body", color.GREEN);
cl.defineColor("inside h-a body", color.dark_gray);
# author: allen everhart
# date: 7jun2015
cl.defineColor("below h-a body", color.RED);
# copylefts reserved. This is free software. That means you are free
# to use or modify it for your own usage but not for resale.
# Help me get the word out about my blog by keeping this header
# in place.
cl.assignValueColor(
    if close>ohlc4 && heikinAshiDiff()>0 then cl.color("above h-a body")
    else if close<ohlc4 && heikinAshiDiff()<0 then cl.color("below h-a body")
# copylefts reserved. This is free software. That means you are free
# to use or modify it for your own usage but not for resale.
    else if heikinAshiDiff()<0 and close>ohlc4-heikinAshiDiff() then  cl.color("above h-a body")
    else if heikinAshiDiff()>0 and close<ohlc4-heikinAshiDiff() then cl.color("below h-a body")
    else cl.color("inside h-a body"));
 
This one shows you where the price closed on Heikin Ashi and the color indicates if the price closes above (green), below(red) or inside (gray)

Code:
# sdi_closeLevel
plot cl = close;
cl.setpaintingStrategy(PaintingStrategy.HORIZONTAL);
#hint: plot the close level as a horizontal line with the color determined by its relationship to the heiken-ashi body.
cl.defineColor("above h-a body", color.GREEN);
cl.defineColor("inside h-a body", color.dark_gray);
# author: allen everhart
# date: 7jun2015
cl.defineColor("below h-a body", color.RED);
# copylefts reserved. This is free software. That means you are free
# to use or modify it for your own usage but not for resale.
# Help me get the word out about my blog by keeping this header
# in place.
cl.assignValueColor(
    if close>ohlc4 && heikinAshiDiff()>0 then cl.color("above h-a body")
    else if close<ohlc4 && heikinAshiDiff()<0 then cl.color("below h-a body")
# copylefts reserved. This is free software. That means you are free
# to use or modify it for your own usage but not for resale.
    else if heikinAshiDiff()<0 and close>ohlc4-heikinAshiDiff() then  cl.color("above h-a body")
    else if heikinAshiDiff()>0 and close<ohlc4-heikinAshiDiff() then cl.color("below h-a body")
    else cl.color("inside h-a body"));
Thank you. Would you be able to know if there is a code that shows the actual open and close of a regular candle overlaid in the Heiken Ashi candle. Maybe the open in cyan or white and the close in either red or green depending on the level as you have it above?
 
Thank you. Would you be able to know if there is a code that shows the actual open and close of a regular candle overlaid in the Heiken Ashi candle. Maybe the open in cyan or white and the close in either red or green depending on the level as you have it above?

One of the simplest might be this

Code:
plot c = close;
plot o = open;
c.setdefaultColor(color.cyan);
o.setdefaultColor(color.white);
c.setpaintingStrategy(PaintingStrategy.DASHES);
o.setpaintingStrategy(PaintingStrategy.DASHES);
c.setlineWeight(3);
o.setlineWeight(3);
 

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
574 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