First Heikin-Ashi Bullish Candlestick with No Lower Wick after 2 or more Red Candles


Category:
0
0

Hi Pete, In a previous post (https://www.hahn-tech.com/ans/scanning-for-heikin-ashi-bullish-candle-with-no-lower-wick/) you show for a bullish heikin ashi candle with no lower wick. I was wondering if you could expand on this and show: 1) How to scan for the first bullish candle (no lower wick) after a set of 2 or more red candles  and 2) A separate scan that finds the first bearish candle (no upper wick) after a set of 2 or more green candles? I don’t want anything returned that is later in trend. The scan would be meant to only catch the beginnings of trend shifts. Thanks!

Marked as spam
Posted by (Questions: 8, Answers: 10)
Asked on January 21, 2019 4:15 pm
514 views
0
Private answer

This should do the trick. The two scans are included in the same code. Noice the last four lines of code contain comments indicating what each of the scans will do. Only one scan can be run at one time, so the last one is marked off using a comment “#” symbol. Simply move the “#” symbol to switch between the two scans.

def haClose = ohlc4;
def haOpen = if haOpen[1] == 0 then haClose[1] else (haOpen[1] + haClose[1]) / 2;
def haHigh = Max(high, Max(haClose, haOpen));
def haLow = Min(low, Min(haClose, haOpen));
def haGreen = haClose > haOpen;
def twoHaGreen = haGreen[1] and haGreen;
def haRed = haClose < haOpen;
def twoHaRed = haRed[1] and haRed;
def noLowerWickGreen = haClose > haOpen and haOpen == haLow;
def noUpperWickRed = haClose < haOpen and haOpen == haHigh;
# use this to scan for two reds followed by first green
plot scan = twoHaRed[1] and noLowerWickGreen;
# use this to scan for two greens followed by first red
#plot scan = twoHaGreen[1] and noUpperWickRed;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 22, 2019 10:45 am
0

I will give it a try. Thanks Pete!

( at January 22, 2019 5:47 pm)
0
Hi Pete, After testing this neither scan is returning results. I have tested in multiple time frames. Were you able to return results with this? Also, I am wondering if this code will cover occurrences where their may be a green day that has a lower wick between the red candles and first green day with no lower wick? I would want to include these if possible.
( at January 24, 2019 5:28 am)
0

I just broke down the code to trouble shoot the individual pieces. The statement to find two consecutive red or green works correctly. The statement that checks for first red with no upper wick or green with now lower wick works correctly.

The two patterns combined may be an extremely rare price pattern. Or it is also possible the way the H-A is computed actually makes it impossible to occur. Have you actually observed these price patterns on a chart? Provide ticker symbol using daily time frame if you have an example.

( at January 24, 2019 8:25 am)
0

It isn’t a rare occurrence. It happens at some point in the beginning of every up or down trend. I have circled the trigger candle in two bullish examples here: https://www.evernote.com/shard/s39/sh/120c7047-ec40-4d27-b885-cf325af0eb96/3f5e15fdaf9f039544769ef0d2f277cf

( at January 24, 2019 8:51 am)
0

Thanks for providing the screenshots. I have updated the code in my answer to correct the issue preventing it from picking up the signals specified.

As to your screenshots. The first one, shows the marked candle as the second green with no lower wick after two reds. This code will not pick up that signal as it does not fit my interpretation of your original specification. If that really is a valid signal the code needs further adjustment.

If this is the case you will also have to provide more details. Such as: Two consecutive red candles followed by any number of green candles until you encounter one with no lower wick? How many green candles after the pair of reds are permitted until you come across a green with no bottom wick and it still counts?

The modifications I just made will however pick up the signal you marked on the second screenshot. Which is the first green candle after two consecutive reds, while also having no lower wick.

( at January 28, 2019 9:54 am)