Heiken Ashi Momentum Arrow UP/DOWN on Chart with no WICK

Montana101x

New member
Hello Everyone,
I was looking for Arrow signal on Heiken Ashi chart with no wick to give me confident for holding position to bigger move. I was unable to find it except on haha-tech forum but it was an incomplete code. Since i don't know coding and i can't figure it out but i will share the post link for anyone can crack the code for this strategy into scripting and thank you. https://www.hahn-tech.com/ans/scann...CQ_lcU5HWUFpT2jS60RL3ZQYhok0VNW5PjTkSPvpNHFkI
fUyrX6R.png
 
Solution
#Hi Montana101x, try the following.

def HAclose = ohlc4;
rec HAopen = compoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh = Max( high, Max( HAopen, HAclose ) );
def HAlow = Min( low, Min( HAopen, HAclose ) );
def haBuy = HAopen <= HAlow;
def haSell = HAopen >= HAhigh;
rec count=if haBuy==1 and count[1]==0 then 1 else if haSell==0 and count[1]>=1 then count[1]+1 else 0;
rec count1=if haSell==1 and count1[1]==0 then 1 else if haBuy==0 and count1[1]>=1 then count1[1]+1 else 0;
def PrimaryUP = if HAopen <= HAlow and habuy==1 and count[1]==0 then yes else no;
def PrimaryDOWN = if HAopen >= HAhigh and hasell==1 and count1[1]==0 then yes else no;

plot ArrowUp = if PrimaryUP then HAlow else Double.NaN...
#Hi Montana101x, try the following.

def HAclose = ohlc4;
rec HAopen = compoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh = Max( high, Max( HAopen, HAclose ) );
def HAlow = Min( low, Min( HAopen, HAclose ) );
def haBuy = HAopen <= HAlow;
def haSell = HAopen >= HAhigh;
rec count=if haBuy==1 and count[1]==0 then 1 else if haSell==0 and count[1]>=1 then count[1]+1 else 0;
rec count1=if haSell==1 and count1[1]==0 then 1 else if haBuy==0 and count1[1]>=1 then count1[1]+1 else 0;
def PrimaryUP = if HAopen <= HAlow and habuy==1 and count[1]==0 then yes else no;
def PrimaryDOWN = if HAopen >= HAhigh and hasell==1 and count1[1]==0 then yes else no;

plot ArrowUp = if PrimaryUP then HAlow else Double.NaN;
ArrowUp.SetDefaultColor(Color.Dark_Orange);
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_Up);
ArrowUp.SetLineWeight(5);
ArrowUp.HideBubble();


plot ArrowDn = if PrimaryDOWN then HAhigh else Double.NaN;
ArrowDn.SetDefaultColor(Color.Dark_Orange);
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDn.SetLineWeight(5);
ArrowDn.HideBubble();
def shavenBottom = HAopen <= HAlow;
def shavenTop = HAopen >= HAhigh;

plot DotUp = if shavenBottom then HAlow * 0.999 else double.nan;
DotUp.SetPaintingStrategy(paintingStrategy.LINE_VS_POINTS);
DotUp.SetDefaultColor(CreateColor(40, 150, 100));
DotUp.SetLineWeight(4);
DotUp.HideBubble();
#DotUp.Hide();

plot DotDn = if shavenTop then HAhigh * 1.001 else double.nan;
DotDn.SetPaintingStrategy(paintingStrategy.LINE_VS_POINTS);
DotDn.SetDefaultColor(CreateColor(255, 20, 0));
DotDn.SetLineWeight(4);
DotDn.HideBubble();
#DotDn.Hide();
 
Solution

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

#Hi Montana101x, try the following.

def HAclose = ohlc4;
rec HAopen = compoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh = Max( high, Max( HAopen, HAclose ) );
def HAlow = Min( low, Min( HAopen, HAclose ) );
def haBuy = HAopen <= HAlow;
def haSell = HAopen >= HAhigh;
rec count=if haBuy==1 and count[1]==0 then 1 else if haSell==0 and count[1]>=1 then count[1]+1 else 0;
rec count1=if haSell==1 and count1[1]==0 then 1 else if haBuy==0 and count1[1]>=1 then count1[1]+1 else 0;
def PrimaryUP = if HAopen <= HAlow and habuy==1 and count[1]==0 then yes else no;
def PrimaryDOWN = if HAopen >= HAhigh and hasell==1 and count1[1]==0 then yes else no;

plot ArrowUp = if PrimaryUP then HAlow else Double.NaN;
ArrowUp.SetDefaultColor(Color.Dark_Orange);
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_Up);
ArrowUp.SetLineWeight(5);
ArrowUp.HideBubble();


plot ArrowDn = if PrimaryDOWN then HAhigh else Double.NaN;
ArrowDn.SetDefaultColor(Color.Dark_Orange);
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDn.SetLineWeight(5);
ArrowDn.HideBubble();
def shavenBottom = HAopen <= HAlow;
def shavenTop = HAopen >= HAhigh;

plot DotUp = if shavenBottom then HAlow * 0.999 else double.nan;
DotUp.SetPaintingStrategy(paintingStrategy.LINE_VS_POINTS);
DotUp.SetDefaultColor(CreateColor(40, 150, 100));
DotUp.SetLineWeight(4);
DotUp.HideBubble();
#DotUp.Hide();

plot DotDn = if shavenTop then HAhigh * 1.001 else double.nan;
DotDn.SetPaintingStrategy(paintingStrategy.LINE_VS_POINTS);
DotDn.SetDefaultColor(CreateColor(255, 20, 0));
DotDn.SetLineWeight(4);
DotDn.HideBubble();
#DotDn.Hide();
Thank you so much. This's what it looks like on my chart
9W1A39S.png
 
Last edited by a moderator:
#Add the following and it will give you audio alerts.

Alert(ArrowDn, "Heikin_Ashi Bear", Alert.BAR, Sound.Chimes);
Alert(ArrowUp, "Heikin_Ashi Bull", Alert.BAR, Sound.Chimes);
 
Looking for a script for when a heikin ashi candle closes flat bottom for the first time or flat top for the first time to give me an Arrow up or down, so I can easily spot a trend reversal.
 
Can the script be change so we get the arrow when candle closes flat top or flat bottom so we dont get fake outs. A lot of times we get arrows when candle opens then candle closes and arrow disappears. Thanks in advance!
 
Can the script be change so we get the arrow when candle closes flat top or flat bottom so we dont get fake outs. A lot of times we get arrows when candle opens then candle closes and arrow disappears. Thanks in advance!
Just wait until the candle closes. It is never wise to take a signal inter-bar!
 
Can the script be change so we get the arrow when candle closes flat top or flat bottom so we dont get fake outs. A lot of times we get arrows when candle opens then candle closes and arrow disappears. Thanks in advance!
The ToS syntax to look at the prior candle (the candle that is final) is [1]
Therefore, to get the arrow on the prior candle

change:
Code:
plot ArrowUp = if PrimaryUP then HAlow else Double.NaN;
to

Rich (BB code):
plot ArrowUp = if PrimaryUP[1] then HAlow else Double.NaN;

and this:
Code:
plot ArrowDn = if PrimaryDOWN then HAhigh else Double.NaN;
to

Rich (BB code):
plot ArrowDn = if PrimaryDOWN[1] then HAhigh else Double.NaN;
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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