Heiken Ashi signal change

BannonMan85

New member
Hello, is there a way to change the signal of this indicator from a color change into an arrow that can be scanned?

Code:
declare upper;

input changeCandleColor = yes;
input dojiBodyRatio = 0.05;

def hc = OHLC4;
def ho = CompoundValue(1, (ho[1] + hc[1]) / 2, hc);
def hh = Max(Max(high, ho), hc);
def hl = Min(Min(low, ho), hc);
def hRange = (hh-hl);
def doji_data = AbsValue(ho - hc) <= (hRange) * dojiBodyRatio;
def HAclose   =  ohlc4;
def HAopen    = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh    = Max( high, Max( HAopen, HAclose ) );
def HAlow     = Min( low, Min( HAopen, HAclose ) );

input testbubble = yes;
AddChartBubble(testbubble and HAopen == HAhigh, HAhigh, high, Color.YELLOW);
AddChartBubble(testbubble and HAopen == HAlow, HAlow, low, Color.WHITE, no);
 
Last edited by a moderator:
Solution
Hello, is there a way to change the signal of this indicator from a color change into an arrow that can be scanned?

Code:
declare upper;

input changeCandleColor = yes;
input dojiBodyRatio = 0.05;

def hc = OHLC4;
def ho = CompoundValue(1, (ho[1] + hc[1]) / 2, hc);
def hh = Max(Max(high, ho), hc);
def hl = Min(Min(low, ho), hc);
def hRange = (hh-hl);
def doji_data = AbsValue(ho - hc) <= (hRange) * dojiBodyRatio;
def HAclose   =  ohlc4;
def HAopen    = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh    = Max( high, Max( HAopen, HAclose ) );
def HAlow     = Min( low, Min( HAopen, HAclose ) );

input testbubble = yes;
AddChartBubble(testbubble and HAopen == HAhigh, HAhigh, high, Color.YELLOW)...
Hello, is there a way to change the signal of this indicator from a color change into an arrow that can be scanned?

Code:
declare upper;

input changeCandleColor = yes;
input dojiBodyRatio = 0.05;

def hc = OHLC4;
def ho = CompoundValue(1, (ho[1] + hc[1]) / 2, hc);
def hh = Max(Max(high, ho), hc);
def hl = Min(Min(low, ho), hc);
def hRange = (hh-hl);
def doji_data = AbsValue(ho - hc) <= (hRange) * dojiBodyRatio;
def HAclose   =  ohlc4;
def HAopen    = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh    = Max( high, Max( HAopen, HAclose ) );
def HAlow     = Min( low, Min( HAopen, HAclose ) );

input testbubble = yes;
AddChartBubble(testbubble and HAopen == HAhigh, HAhigh, high, Color.YELLOW);
AddChartBubble(testbubble and HAopen == HAlow, HAlow, low, Color.WHITE, no);

DefineGlobalColor("H", Color.RED);
DefineGlobalColor("L", Color.MAGENTA);
WOW! This charts with the colors codes from going up - to ranging - to going down is amazing. Today is saturday, Can't wait to try it out on Monday. Thank you. Ed
 
Last edited:
Hello, is there a way to change the signal of this indicator from a color change into an arrow that can be scanned?

Code:
declare upper;

input changeCandleColor = yes;
input dojiBodyRatio = 0.05;

def hc = OHLC4;
def ho = CompoundValue(1, (ho[1] + hc[1]) / 2, hc);
def hh = Max(Max(high, ho), hc);
def hl = Min(Min(low, ho), hc);
def hRange = (hh-hl);
def doji_data = AbsValue(ho - hc) <= (hRange) * dojiBodyRatio;
def HAclose   =  ohlc4;
def HAopen    = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh    = Max( high, Max( HAopen, HAclose ) );
def HAlow     = Min( low, Min( HAopen, HAclose ) );

input testbubble = yes;
AddChartBubble(testbubble and HAopen == HAhigh, HAhigh, high, Color.YELLOW);
AddChartBubble(testbubble and HAopen == HAlow, HAlow, low, Color.WHITE, no);
Enjoy!

Code:
declare upper;

input changeCandleColor = yes;
input dojiBodyRatio = 0.05;

def hc = OHLC4;
def ho = CompoundValue(1, (ho[1] + hc[1]) / 2, hc);
def hh = Max(Max(high, ho), hc);
def hl = Min(Min(low, ho), hc);
def hRange = (hh-hl);
def doji_data = AbsValue(ho - hc) <= (hRange) * dojiBodyRatio;
def HAclose   =  ohlc4;
def HAopen    = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh    = Max( high, Max( HAopen, HAclose ) );
def HAlow     = Min( low, Min( HAopen, HAclose ) );

input testbubble = yes;
AddChartBubble(testbubble and HAopen == HAhigh, HAhigh, high, Color.YELLOW);
AddChartBubble(testbubble and HAopen == HAlow, HAlow, low, Color.WHITE, no);

def hiArrow = if HAopen == HAhigh && HAopen[1] != HAhigh[1] then 1 else double.NaN;
def loArrow = if HAopen == HAlow && HAopen[1] != HAlow[1] then 1 else double.NaN;

plot UpArrow = hiArrow;
plot DnArrow = loArrow;

UpArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DnArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


DefineGlobalColor("H", Color.RED);
DefineGlobalColor("L", Color.MAGENTA);

input pricecolor = yes;
AssignPriceColor(if !pricecolor then Color.CURRENT
else if HAopen == HAhigh then GlobalColor("H")
else if HAopen == HAlow then GlobalColor("L")
else Color.YELLOW);
plot doji_green = if doji_data and (hc > ho) then 1 else Double.NaN;
doji_green.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
doji_green.SetDefaultColor(Color.WHITE);

plot doji_red = if doji_data and (ho > hc) then 1 else Double.NaN;
doji_red.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
doji_red.SetDefaultColor(Color.WHITE);

AssignPriceColor(if changeCandleColor and doji_data then Color.WHITE else Color.CURRENT);
 
Last edited by a moderator:
Solution
Enjoy!

Code:
declare upper;

input changeCandleColor = yes;
input dojiBodyRatio = 0.05;

def hc = OHLC4;
def ho = CompoundValue(1, (ho[1] + hc[1]) / 2, hc);
def hh = Max(Max(high, ho), hc);
def hl = Min(Min(low, ho), hc);
def hRange = (hh-hl);
def doji_data = AbsValue(ho - hc) <= (hRange) * dojiBodyRatio;
def HAclose   =  ohlc4;
def HAopen    = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh    = Max( high, Max( HAopen, HAclose ) );
def HAlow     = Min( low, Min( HAopen, HAclose ) );

input testbubble = yes;
AddChartBubble(testbubble and HAopen == HAhigh, HAhigh, high, Color.YELLOW);
AddChartBubble(testbubble and HAopen == HAlow, HAlow, low, Color.WHITE, no);

def hiArrow = if HAopen == HAhigh && HAopen[1] != HAhigh[1] then 1 else double.NaN;
def loArrow = if HAopen == HAlow && HAopen[1] != HAlow[1] then 1 else double.NaN;

plot UpArrow = hiArrow;
plot DnArrow = loArrow;

UpArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DnArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


DefineGlobalColor("H", Color.RED);
DefineGlobalColor("L", Color.MAGENTA);

input pricecolor = yes;
AssignPriceColor(if !pricecolor then Color.CURRENT
else if HAopen == HAhigh then GlobalColor("H")
else if HAopen == HAlow then GlobalColor("L")
else Color.YELLOW);
plot doji_green = if doji_data and (hc > ho) then 1 else Double.NaN;
doji_green.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
doji_green.SetDefaultColor(Color.WHITE);

plot doji_red = if doji_data and (ho > hc) then 1 else Double.NaN;
doji_red.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
doji_red.SetDefaultColor(Color.WHITE);

AssignPriceColor(if changeCandleColor and doji_data then Color.WHITE else Color.CURRENT);
Thanks for this. From what I saw was that the arrows are flipped. the down arrow is appearing on a bullish signal and the up arrow is popping up on the bearish signal. I will try to correct it and post it here if I can. This is awesome though. Thank you once again

(Edit)

I think I fixed it.

Code:
declare upper;

input changeCandleColor = yes;
input dojiBodyRatio = 0.05;

def hc = OHLC4;
def ho = CompoundValue(1, (ho[1] + hc[1]) / 2, hc);
def hh = Max(Max(high, ho), hc);
def hl = Min(Min(low, ho), hc);
def hRange = (hh-hl);
def doji_data = AbsValue(ho - hc) <= (hRange) * dojiBodyRatio;
def HAclose   =  ohlc4;
def HAopen    = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh    = Max( high, Max( HAopen, HAclose ) );
def HAlow     = Min( low, Min( HAopen, HAclose ) );

input testbubble = yes;
AddChartBubble(testbubble and HAopen == HAhigh, HAhigh, high, Color.YELLOW);
AddChartBubble(testbubble and HAopen == HAlow, HAlow, low, Color.WHITE, no);

def hiArrow = if HAclose > HAhigh[1] and HAclose > HAopen and HAopen >= HAlow then low else Double.NaN;
def loArrow = if HAclose < HAlow[1] and HAclose < HAopen and HAopen <= HAhigh then high else Double.NaN;

plot UpArrow = hiArrow;
plot DnArrow = loArrow;

UpArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DnArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);


DefineGlobalColor("H", Color.RED);
DefineGlobalColor("L", Color.MAGENTA);

input pricecolor = yes;
AssignPriceColor(if !pricecolor then Color.CURRENT
else if HAopen == HAhigh then GlobalColor("H")
else if HAopen == HAlow then GlobalColor("L")
else Color.YELLOW);
plot doji_green = if doji_data and (hc > ho) then 1 else Double.NaN;
doji_green.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
doji_green.SetDefaultColor(Color.WHITE);

plot doji_red = if doji_data and (ho > hc) then 1 else Double.NaN;
doji_red.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
doji_red.SetDefaultColor(Color.WHITE);

AssignPriceColor(if changeCandleColor and doji_data then Color.WHITE else Color.CURRENT);
 
Last edited:
WOW! This charts with the colors copes from going up - to ranging - to going down is amazing. Today is saturday, Can't wait to try it out on Monday. Thank you. Ed
Well, I used your new colored system. I increase my profits by more than 100%. Instead of getting into a trade when the market starts, if the candles are yellow (going sideways) I do not go in. I wait till they turn green or red. Man, my confidence going into a trade increased. I went from making $1,000 a day to an average of $2,000 to $2,500. I hope to increase this to over $4,000 a day by January. Thank you, thank you, thank you. Happy Thanskgiving. Ed
 
Well, I used your new colored system. I increase my profits by more than 100%. Instead of getting into a trade when the market starts, if the candles are yellow (going sideways) I do not go in. I wait till they turn green or red. Man, my confidence going into a trade increased. I went from making $1,000 a day to an average of $2,000 to $2,500. I hope to increase this to over $4,000 a day by January. Thank you, thank you, thank you. Happy Thanskgiving. Ed
Truly impressive results. I'm curious as to how you're using, as I see the indicator as being very noisy.
 
Well, I used your new colored system. I increase my profits by more than 100%. Instead of getting into a trade when the market starts, if the candles are yellow (going sideways) I do not go in. I wait till they turn green or red. Man, my confidence going into a trade increased. I went from making $1,000 a day to an average of $2,000 to $2,500. I hope to increase this to over $4,000 a day by January. Thank you, thank you, thank you. Happy Thanskgiving. Ed
Sorry, newbie here. What are you trying to achieve and how is this different than just looking at Heikin Ashi Flat bottom or Flat top?
 
Truly impressive results. I'm curious as to how you're using, as I see the indicator as being very noisy.
Sorry, newbie here. What are you trying to achieve and how is this different than just looking at Heikin Ashi Flat bottom or Flat top?

Hi, not sure what indicator you are talking about. But as far as the Heiken Ashi candles are concern, they work for me. I use the 20 and 200 EMA at market open. When the 20 breaks away from the 200 I enter the trade. Before I would make mistakes and enter too early or late and suffered some stress. Now if the market opens and the first two or three candles are yellow, I do not enter. I wait till the candles turn red or green and then I enter. I normally trade options. So when it turns green I go in with more contracts with a comfort level that it will move in the right direction. I have more than doubled my winnings in the last two weeks. I like this a lot. I find it very helpful. Everyone is different. The candles don't look "noisy" for me. Hope this helps. If you like I can attach a picture if you want. let me know. Happy to help. Ed.
 
Hi, not sure what indicator you are talking about. But as far as the Heiken Ashi candles are concern, they work for me. I use the 20 and 200 EMA at market open. When the 20 breaks away from the 200 I enter the trade. Before I would make mistakes and enter too early or late and suffered some stress. Now if the market opens and the first two or three candles are yellow, I do not enter. I wait till the candles turn red or green and then I enter. I normally trade options. So when it turns green I go in with more contracts with a comfort level that it will move in the right direction. I have more than doubled my winnings in the last two weeks. I like this a lot. I find it very helpful. Everyone is different. The candles don't look "noisy" for me. Hope this helps. If you like I can attach a picture if you want. let me know. Happy to help. Ed.
Yes, a picture of a recent trade that you took using the EMAs and the HA indicator would be most appreciated. Also, the time frame and the instruments you trade to achieve these superior results. Thanks in advance kind sir. 🙏
 

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