Heiken Ashi Overlay Displaced

EnV-T

New member
Good morning everyone.

I have been switching my usage to heiken ashi candles
https://usethinkscript.com/threads/heikin-ashi-for-thinkorswim.2268/#post-71161
for trading and was wondering if it would be possible to have a heiken ashi candle overlay on a chart while having the default candlesticks on the chart. What I mean is.. if I trade off a 10 min time frame chart, by default, I want to have the regular candlesticks on the chart and have the heiken ashi candlesticks of that ticker displaced a few spaces below the regular candlesticks to help me identify not only trend but to also help me see if we are going to get some sort of reversal. Please let me know if this would be possible. Thank you for your help.
 
Last edited by a moderator:
Solution
Good morning everyone.

I have been switching my usage to heiken ashi candles
https://usethinkscript.com/threads/heikin-ashi-for-thinkorswim.2268/#post-71161
for trading and was wondering if it would be possible to have a heiken ashi candle overlay on a chart while having the default candlesticks on the chart. What I mean is.. if I trade off a 10 min time frame chart, by default, I want to have the regular candlesticks on the chart and have the heiken ashi candlesticks of that ticker displaced a few spaces below the regular candlesticks to help me identify not only trend but to also help me see if we are going to get some sort of reversal. Please let me know if this would be possible. Thank you for your help.

This will...
Good morning everyone.

I have been switching my usage to heiken ashi candles
https://usethinkscript.com/threads/heikin-ashi-for-thinkorswim.2268/#post-71161
for trading and was wondering if it would be possible to have a heiken ashi candle overlay on a chart while having the default candlesticks on the chart. What I mean is.. if I trade off a 10 min time frame chart, by default, I want to have the regular candlesticks on the chart and have the heiken ashi candlesticks of that ticker displaced a few spaces below the regular candlesticks to help me identify not only trend but to also help me see if we are going to get some sort of reversal. Please let me know if this would be possible. Thank you for your help.

This will displace the HA candles created with the code in your link.
A positive number displaced will plot the candles above the chart candles and a minus will be below
An option to instead of HA candles you can plot HA_candle_trend defaulted to lines and dots
You can choose to hide the HA candles and/or HA_candle_trend plots
The image shows both HA candles and HA_candle_trend dots for comparison

[
Screenshot 2024-09-04 100550.jpg
CODE]#Draw the Heinkin Ashi candle
input show_HA_candles = yes;
input show_HA_candle_trend = yes;
input HA_displace = 8;#Hint HA_displace: Plus numbers will displace above chart candlse and Minus below

#----------------------------
#HeikenAshi Candles Defined
def HAhigh;
def HAlow;
def HAclose;
def HAopen = CompoundValue(1, (HAopen[1] + HAclose[1]) / 2, (open[1] + close[1]) / 2);
HAclose = (open + high + low + close) / 4;
HAhigh = Max(Max(high, HAopen), HAclose[1]);
HAlow = Min(Min(low, HAopen), HAclose[1]);
def HA_open = Round(HAopen, 2);
def diff = HAclose - HAopen;

AddChart(if !show_HA_candles then Double.NaN else HAhigh + HA_displace * TickSize() , HAlow + HA_displace * TickSize(), HA_open + HA_displace * TickSize(), HAclose + HA_displace * TickSize(), type = ChartType.CANDLE, growcolor = Color.LIGHT_ORANGE);


#Edit the plot for these as boolean type and use up/down arrow to show on your chart if you want to add Heinkin Ashi Signal for trend changing
def HA_Down = if diff > 0 and diff[1] <= 0 then 1 else 0;
def HA_Up = if diff < 0 and diff[1] >= 0 then 1 else 0;

#----------------------------
#HA Candle Trend
def HA_candle_trend_ = if BarNumber() == 1 then Double.NaN else if HAopen <= HAclose then 1 else if HAopen > HAclose then 0 else HA_candle_trend_[1];
plot HA_candle_trend = (if HA_displace > 0 then high else low) + HA_displace * TickSize();
HA_candle_trend.AssignValueColor(if HA_candle_trend_ == 1 then Color.GREEN else Color.RED);
HA_candle_trend.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
HA_candle_trend.SetLineWeight(2);
HA_candle_trend.SetHiding(!show_HA_candle_trend);

#[/CODE]
 
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
422 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