Alert on Heikin Ashi Candle wicks on both sides


Category:
0
0

Hello Mr. Hahn,

Would it be possible to code an indicator with an alert when a Heikin Ashi candle has wicks on both sides. This should happen on candle close. I believe this is feasible because we can determine when a candle is a candle with only a top or bottom wick and would just exclude those candles from the alerts.

A marker on the alert candle (an arrow at the top or bottom) would be great too.

If at all possible, if the alert candle is bullish (green), then a UpTrend arrow, and if its bearish (red), then a downtrend arrow. If this is not feasible, then just a arrow anywhere on all alert candles would do.

 

Thank you so much for your assistance.

 

Thanks,

 

Ajay

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on May 3, 2023 10:38 am
207 views
0
Private answer

Since you are asking for a chart study solution, I have moved this question out of the "Alerts and Notifications" topic and into the "Chart Studies" topic.

We have received many requests for solutions based on Heikin-Ashi charts. So for this solution I have tried to anticipate all of the various other ways that folks may want to configure this. I have provided three user inputs which can be used to change the behavior. I included three screenshots below showing how these settings impact the behavior. The default settings are intended to match the details of your own request.

input topWick = yes;
input bottomWick = yes;
input direction = {default Both, Up, Down};
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 haUp = haClose > haOpen;
def haDown = haClose < haOpen; def filterDirection = if direction == direction.Both then yes else if direction == direction.Up then haUp else haDown; def filterTopWick = if topWick then haHigh > haOpen and haHigh > haOpen else (haUp and haHigh == haClose) or (haDown and haHigh == haOpen);
def filterBottomWick = if bottomWick then haLow < haOpen and haLow < haClose else (haUp and haLow == haOpen) or (haDown and haLow == haClose);
plot signalTop = filterDirection and filterTopWick and filterBottomWick;
signalTop.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);
signalTop.AssignValueColor(if haUp then Color.GREEN else Color.RED);
signalTop.SetLineWeight(3);
plot signalBottom = filterDirection and filterTopWick and filterBottomWick;
signalBottom.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
signalBottom.AssignValueColor(if haUp then Color.GREEN else Color.RED);
signalBottom.SetLineWeight(3);
Alert(signalTop[1], "HA Wick Pattern", Alert.BAR, Sound.RING);

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on May 3, 2023 3:26 pm