Automatic Chart pattern finder needed

Hi team @Dhan @PravinJ @RahulDeshpande @Hardik @shraddha
Whenever the chart patterns from in Stocks and Index it has to appear. Kindly refer following screen shot. Is there any possibility to bring this in Dhan Charts itself. Thank you


1 Like

Hello @Dhanush4777,

Thanks for the suggestion. It would be great if chart patterns could automatically appear on Stocks and Indices in Dhan charts.

1 Like

@Dhanush4777 It’s a great suggestion, and I would like to know which app you are using which gives this feature of “Chart Patterns”. ET Markets had this feature, but later removed it as analysing chart patterns on multiple time frames is a huge burden.

Dhan provides an indicator, i.e. “Dhan Candlestick Patterns”. Alternatively, you can create a watchlist of stocks and then apply this indicator to see if the relevant chart patterns are occurring on the stock’s chart or not.

2 Likes

Thank you @nitishbangera , This is shared to me by one of my friends. The app is Angelone.

Most welcome @Madiya_Khatri

Hi @Dhanush4777 @nitishbangera

Already on Dhan Charts. Live since Dec 2024

Also available on scanx.trade, under Candlestick Screeners and available as filters in Create section as well.

@Naman Thank you for sharing the details of the screener, but I think that is not what the original requirement of the post was, which was “chart patterns”. Candlestick patterns were an alternative, but not exactly the same as chart patterns.

1 Like

Yes exactly @nitishbangera.
@Naman Kindly consider the screen shot which I have shared at the beginning.

@nitishbangera Chart patterns aren’t available here. Only candlestick patterns such as marubozu, shooting star, etc… is available on Dhan.

Chart patterns means falling wedge, triangle, h&s… it is only available on AngelOne discover lists and index section. @Dhanush4777 not on Dhan currently.

@thisisbanerjee Yup, I am aware and hence I had suggested Candlestick patterns as an alternative. ET Markets had this feature, but they removed it because of the tracking that is involved in it. Angelone is cool to still giving this feature to its users.

1 Like

Yes @thisisbanerjee not available on dhan that’s why we have requesting to bring this on dhan charts ( tv.dhan.co) :slightly_smiling_face:

You can pinescript the patterns and see it on TV premium… TV premium also gives the pattern recognition stuff, if you need it…

@nitishbangera @Dhanush4777

Here’s a falling wedge pattern, that I have generated for you guys… An example. This won’t be 100% accurate because patterns also rely on visual geometry… but it detect 90% of them.

//@version=5
indicator(“Falling Wedge Detector by Souvik”, overlay=true)

// === INPUTS === //
pivot_length = input.int(5, “Pivot Lookback”, minval=1)
min_swings = input.int(3, “Minimum Number of Swing Highs/Lows”, minval=2)
slope_tolerance = input.float(0.5, “Max Difference in Slopes”, step=0.1)
show_lines = input.bool(true, “Show Wedge Lines”)

// === SWING POINT DETECTION === //
isSwingHigh = high[pivot_length] > ta.highest(high, pivot_length * 2 + 1)
isSwingLow = low[pivot_length] < ta.lowest(low, pivot_length * 2 + 1)

var float swingHighs = array.new_float()
var int swingHighBars = array.new_int()
var float swingLows = array.new_float()
var int swingLowBars = array.new_int()

if isSwingHigh
array.push(swingHighs, high[pivot_length])
array.push(swingHighBars, bar_index - pivot_length)

if isSwingLow
array.push(swingLows, low[pivot_length])
array.push(swingLowBars, bar_index - pivot_length)

// === FUNCTION TO CALCULATE LINE SLOPE === //
f_slope(x1, y1, x2, y2) =>
(y2 - y1) / math.max(x2 - x1, 1)

// === FALLING WEDGE LOGIC === //
wedge_found = false
var line upperLine = na
var line lowerLine = na

if array.size(swingHighs) >= min_swings and array.size(swingLows) >= min_swings
h1 = array.get(swingHighs, array.size(swingHighs) - min_swings)
h2 = array.get(swingHighs, array.size(swingHighs) - 1)
hb1 = array.get(swingHighBars, array.size(swingHighBars) - min_swings)
hb2 = array.get(swingHighBars, array.size(swingHighBars) - 1)
s_high = f_slope(hb1, h1, hb2, h2)

l1 = array.get(swingLows, array.size(swingLows) - min_swings)
l2 = array.get(swingLows, array.size(swingLows) - 1)
lb1 = array.get(swingLowBars, array.size(swingLowBars) - min_swings)
lb2 = array.get(swingLowBars, array.size(swingLowBars) - 1)
s_low = f_slope(lb1, l1, lb2, l2)

if s_high < 0 and s_low < 0 and math.abs(s_high - s_low) <= slope_tolerance
    wedge_found := true
    if show_lines
        if na(upperLine)
            upperLine := line.new(x1=hb1, y1=h1, x2=hb2, y2=h2, color=color.red, width=2)
            lowerLine := line.new(x1=lb1, y1=l1, x2=lb2, y2=l2, color=color.green, width=2)
        else
            line.set_xy1(upperLine, hb1, h1)
            line.set_xy2(upperLine, hb2, h2)
            line.set_xy1(lowerLine, lb1, l1)
            line.set_xy2(lowerLine, lb2, l2)
else
    wedge_found := false
    if show_lines
        line.delete(upperLine)
        line.delete(lowerLine)
        upperLine := na
        lowerLine := na

// === PLOT SIGNAL === //
plotshape(wedge_found ? low : na, location=location.belowbar, style=shape.triangleup, size=size.small, color=color.lime, title=“Falling Wedge Signal”)

Yes I do use in TradingView but if it’s on dhan then it will be easy for everyone @thisisbanerjee

1 Like

@thisisbanerjee Thanks for the PineScript. You are correct that it’s not accurate, and I believe the tech won’t be accurate compared to a manual view :smiley: . The problem is not going through a watchlist and then applying the chart pattern. It’s the other way round, which Angelone does, i.e. identify and then notify.

Btw, to clarify, it wasn’t a debate. It was just a mention that it would be cool to have it, but I do understand that it’s difficult to implement. I would love to have a H&S, Inverted H&S, Double bottom and double bottom and then match it with the Candlestick patterns :slight_smile:

2 Likes

No no @nitishbangera I wasn’t debating. Just thought it might help you out… :slight_smile: AngelOne has problems with their watchlist and chart price sync… the chart prices lag by 3-4 seconds as compared to the watchlist and also opening prices from 9:15 to 9:20 updates very slow as compared to Dhan. They also have a lazyload problem, if you keep the tab idle then the prices and charts both stop updating and you can’t see that in the browser tab…

Given all these problems, I find Dhan to be a blessing… not that Dhan is some bug-free platform but it gets the basic right atleast. What a dilemma. :sweat_smile:

1 Like

@thisisbanerjee That is exactly my view too, hence my suggestion was to keep a watchlist of stocks and apply the candlestick pattern indicator to it so that we do it selectively and still enjoy the speed Dhan gives :slight_smile: . ET prime had AI chart patterns, but given the complexity, they removed it as well :smiley: . As you previously mentioned, if Dhan could integrate the pinescript as an indicator, then it would be cool too, which would apply only on the watchlist and not implement it as an alert.

1 Like