I want to share my indicator can you plot on dhan if add this then please very helpful for all

//@version=5

indicator(“Intraday complete Brahmastra setup - Shiva”, overlay=true, max_labels_count=500, max_boxes_count=500, max_lines_count=500, max_bars_back=500)

// ==================== INPUTS ====================

rsi_length = input.int(14, “RSI Length”, group=“Strategy Settings”)

rsi_buy_level = input.int(60, “RSI Buy Threshold”, group=“Strategy Settings”)

rsi_sell_lev = input.int(40, “RSI Sell Threshold”, group=“Strategy Settings”)

adx_length = input.int(14, “ADX Smoothing”, group=“Strategy Settings”)

di_length = input.int(14, “DI Length”, group=“Strategy Settings”)

adx_threshold = input.int(20, “ADX Threshold”, group=“Strategy Settings”)

ema_len = input.int(9, “EMA Channel Period”, group=“9 EMA Channel”)

st_atr_len = input.int(10, “Supertrend ATR Period”, group=“Supertrend Settings”)

st_factor = input.float(3.0, “Supertrend Factor”, group=“Supertrend Settings”)

atr_trail_len = input.int(14, “Trailing SL ATR Period”, group=“Trailing SL Settings”)

atr_mult = input.float(1.5, “Trailing SL ATR Multiplier”, group=“Trailing SL Settings”)

show_sl_line = input.bool(false, “Show Trailing SL Line on Chart”, group=“Display Settings”)

vbsm_len = input.int(10, “VBSM Period”, group=“VBSM Settings”)

// Historical & Display Toggles

show_hist_levels = input.bool(false, “Show Historical Levels (Past Days)”, group=“Pivot & VIX Customization”)

show_pivot = input.bool(true, “Pivot Point”, inline=“piv”, group=“Pivot & VIX Customization”)

col_pivot = input.color(color.orange, “”, inline=“piv”, group=“Pivot & VIX Customization”)

width_pivot = input.int(2, “Width”, minval=1, maxval=4, inline=“piv”, group=“Pivot & VIX Customization”)

style_pivot = input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“piv”, group=“Pivot & VIX Customization”)

vix_symbol = input.symbol(“NSE:INDIAVIX”, “VIX Index Symbol”, group=“Pivot & VIX Customization”)

show_vix_u = input.bool(true, “VIX Upper”, inline=“vix_u”, group=“Pivot & VIX Customization”)

col_vix_u = input.color(color.red, “”, inline=“vix_u”, group=“Pivot & VIX Customization”)

width_vix_u = input.int(2, “Width”, minval=1, maxval=4, inline=“vix_u”, group=“Pivot & VIX Customization”)

style_vix_u = input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“vix_u”, group=“Pivot & VIX Customization”)

show_vix_l = input.bool(true, “VIX Lower”, inline=“vix_l”, group=“Pivot & VIX Customization”)

col_vix_l = input.color(color.green, “”, inline=“vix_l”, group=“Pivot & VIX Customization”)

width_vix_l = input.int(2, “Width”, minval=1, maxval=4, inline=“vix_l”, group=“Pivot & VIX Customization”)

style_vix_l = input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“vix_l”, group=“Pivot & VIX Customization”)

// Fibonacci Toggles

show_f236 = input.bool(true, “Fib 0.236”, inline=“f236”, group=“Fibonacci Retracements”)

col_f236 = input.color(color.teal, “”, inline=“f236”, group=“Fibonacci Retracements”)

width_f236 = input.int(1, “Width”, minval=1, maxval=4, inline=“f236”, group=“Fibonacci Retracements”)

style_f236 = input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“f236”, group=“Fibonacci Retracements”)

show_f382 = input.bool(true, “Fib 0.382”, inline=“f382”, group=“Fibonacci Retracements”)

col_f382 = input.color(color.aqua, “”, inline=“f382”, group=“Fibonacci Retracements”)

width_f382 = input.int(1, “Width”, minval=1, maxval=4, inline=“f382”, group=“Fibonacci Retracements”)

style_f382 = input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“f382”, group=“Fibonacci Retracements”)

show_f500 = input.bool(true, “Fib 0.500”, inline=“f500”, group=“Fibonacci Retracements”)

col_f500 = input.color(color.blue, “”, inline=“f500”, group=“Fibonacci Retracements”)

width_f500 = input.int(1, “Width”, minval=1, maxval=4, inline=“f500”, group=“Fibonacci Retracements”)

style_f500 = input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“f500”, group=“Fibonacci Retracements”)

show_f618 = input.bool(true, “Fib 0.618”, inline=“f618”, group=“Fibonacci Retracements”)

col_f618 = input.color(color.yellow, “”, inline=“f618”, group=“Fibonacci Retracements”)

width_f618 = input.int(2, “Width”, minval=1, maxval=4, inline=“f618”, group=“Fibonacci Retracements”)

style_f618 = input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“f618”, group=“Fibonacci Retracements”)

show_f786 = input.bool(true, “Fib 0.786”, inline=“f786”, group=“Fibonacci Retracements”)

col_f786 = input.color(color.purple, “”, inline=“f786”, group=“Fibonacci Retracements”)

width_f786 = input.int(1, “Width”, minval=1, maxval=4, inline=“f786”, group=“Fibonacci Retracements”)

style_f786 = input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“f786”, group=“Fibonacci Retracements”)

show_ext127_u = input.bool(true, “Upper 1.272 Ext”, inline=“e127u”, group=“Fibonacci Extensions”)

col_ext127_u = input.color(color.green, “”, inline=“e127u”, group=“Fibonacci Extensions”)

width_ext127_u= input.int(1, “Width”, minval=1, maxval=4, inline=“e127u”, group=“Fibonacci Extensions”)

style_ext127_u= input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“e127u”, group=“Fibonacci Extensions”)

show_ext161_u = input.bool(true, “Upper 1.618 Ext”, inline=“e161u”, group=“Fibonacci Extensions”)

col_ext161_u = input.color(color.lime, “”, inline=“e161u”, group=“Fibonacci Extensions”)

width_ext161_u= input.int(2, “Width”, minval=1, maxval=4, inline=“e161u”, group=“Fibonacci Extensions”)

style_ext161_u= input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“e161u”, group=“Fibonacci Extensions”)

show_ext127_d = input.bool(true, “Lower 1.272 Ext”, inline=“e127d”, group=“Fibonacci Extensions”)

col_ext127_d = input.color(color.maroon, “”, inline=“e127d”, group=“Fibonacci Extensions”)

width_ext127_d= input.int(1, “Width”, minval=1, maxval=4, inline=“e127d”, group=“Fibonacci Extensions”)

style_ext127_d= input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“e127d”, group=“Fibonacci Extensions”)

show_ext161_d = input.bool(true, “Lower 1.618 Ext”, inline=“e161d”, group=“Fibonacci Extensions”)

col_ext161_d = input.color(color.red, “”, inline=“e161d”, group=“Fibonacci Extensions”)

width_ext161_d= input.int(2, “Width”, minval=1, maxval=4, inline=“e161d”, group=“Fibonacci Extensions”)

style_ext161_d= input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“e161d”, group=“Fibonacci Extensions”)

// Volume Profile & Zones

show_vp_poc = input.bool(true, “Volume POC”, inline=“vpoc”, group=“Volume Profile & Zones”)

col_vp_poc = input.color(#FF00FF, “”, inline=“vpoc”, group=“Volume Profile & Zones”)

width_vp_poc = input.int(2, “Width”, minval=1, maxval=4, inline=“vpoc”, group=“Volume Profile & Zones”)

style_vp_poc = input.string(“Solid”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“vpoc”, group=“Volume Profile & Zones”)

show_vp_va = input.bool(true, “VAH / VAL Levels”, inline=“vpva”, group=“Volume Profile & Zones”)

col_vah = input.color(color.blue, “”, inline=“vpva”, group=“Volume Profile & Zones”)

col_val = input.color(color.navy, “”, inline=“vpva”, group=“Volume Profile & Zones”)

width_vp_va = input.int(1, “Width”, minval=1, maxval=4, inline=“vpva”, group=“Volume Profile & Zones”)

style_vp_va = input.string(“Dashed”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“vpva”, group=“Volume Profile & Zones”)

show_vp_vpoc = input.bool(true, “Virgin POC”, inline=“vpoc_v”, group=“Volume Profile & Zones”)

col_vp_vpoc = input.color(color.fuchsia, “”, inline=“vpoc_v”, group=“Volume Profile & Zones”)

width_vp_vpoc = input.int(2, “Width”, minval=1, maxval=4, inline=“vpoc_v”, group=“Volume Profile & Zones”)

style_vp_vpoc = input.string(“Dashed”, “Style”, options=[“Solid”, “Dashed”, “Dotted”], inline=“vpoc_v”, group=“Volume Profile & Zones”)

show_zones = input.bool(true, “Demand/Supply Zones”, inline=“zones”, group=“Volume Profile & Zones”)

col_supply = input.color(color.new(color.red, 75), “Supply”, inline=“zones”, group=“Volume Profile & Zones”)

col_demand = input.color(color.new(color.green, 75), “Demand”, inline=“zones”, group=“Volume Profile & Zones”)

vp_bins = input.int(30, “Volume Profile Precision Bins”, group=“Volume Profile & Zones”)

f_get_style(s) => s == “Dashed” ? line.style_dashed : s == “Dotted” ? line.style_dotted : line.style_solid

// ==================== SESSION TRACKING ====================

is_new_day = ta.change(time(“D”)) != 0

var int last_session_start_bar = na

if is_new_day

last_session_start_bar := bar_index

[prev_high, prev_low, prev_close] = request.security(syminfo.tickerid, “D”, [high[1], low[1], close[1]], gaps=barmerge.gaps_off)

vix_close = request.security(vix_symbol, “D”, close[1], gaps=barmerge.gaps_off)

pivot_val = (prev_high + prev_low + prev_close) / 3.0

vix_move = prev_close * (vix_close / 100.0) / math.sqrt(252.0)

vix_upper = prev_close + vix_move

vix_lower = prev_close - vix_move

swing_range = prev_high - prev_low

fib_0236 = prev_high - (swing_range * 0.236)

fib_0382 = prev_high - (swing_range * 0.382)

fib_0500 = prev_high - (swing_range * 0.500)

fib_0618 = prev_high - (swing_range * 0.618)

fib_0786 = prev_high - (swing_range * 0.786)

fib_1272_ext_u = prev_low + (swing_range * 1.272)

fib_1618_ext_u = prev_low + (swing_range * 1.618)

fib_1272_ext_d = prev_high - (swing_range * 1.272)

fib_1618_ext_d = prev_high - (swing_range * 1.618)

// ==================== VOLUME PROFILE ====================

var float[] bin_vol = array.new_float(vp_bins, 0.0)

var float day_high = na

var float day_low = na

if is_new_day

array.fill(bin_vol, 0.0)

day_high := high

day_low  := low

else

day_high := na(day_high) ? high : math.max(day_high, high)

day_low  := na(day_low)  ? low  : math.min(day_low, low)

if not na(day_high) and day_high > day_low

step_sz = (day_high - day_low) / vp_bins

bin_idx = math.min(vp_bins - 1, math.max(0, int(math.floor((close - day_low) / step_sz))))

array.set(bin_vol, bin_idx, array.get(bin_vol, bin_idx) + volume)

var float poc_price = na

var float vah_price = na

var float val_price = na

var float supply_top = na

var float supply_bot = na

var float demand_top = na

var float demand_bot = na

if (barstate.islast or show_hist_levels) and not na(day_high) and day_high > day_low

max_v = 0.0, max_bin = 0, total_v = 0.0

for b = 0 to vp_bins - 1

    v = array.get(bin_vol, b)

    total_v += v

    if v > max_v

        max_v := v, max_bin := b

        

calc_step = (day_high - day_low) / vp_bins

poc_price := day_low + (max_bin + 0.5) \* calc_step

target_v = total_v \* 0.70, accum_v = max_v, up_idx = max_bin, dn_idx = max_bin

while accum_v < target_v and (up_idx < vp_bins - 1 or dn_idx > 0)

    up_v = up_idx < vp_bins - 1 ? array.get(bin_vol, up_idx + 1) : 0.0

    dn_v = dn_idx > 0           ? array.get(bin_vol, dn_idx - 1) : 0.0

    if up_v >= dn_v and up_idx < vp_bins - 1

        up_idx += 1, accum_v += up_v

    else if dn_idx > 0

        dn_idx -= 1, accum_v += dn_v

    else if up_idx < vp_bins - 1

        up_idx += 1, accum_v += up_v

vah_price  := day_low + (up_idx + 1) \* calc_step

val_price  := day_low + dn_idx \* calc_step

supply_top := day_high

supply_bot := math.max(poc_price, day_high - (day_high - day_low) \* 0.15)

demand_top := math.min(poc_price, day_low + (day_high - day_low) \* 0.15)

demand_bot := day_low

// — HISTORICAL VIRGIN POC ARRAY TRACKING —

var line[] vpoc_lines = array.new_line()

var bool[] vpoc_active = array.new_bool()

if is_new_day[1] and not na(poc_price[1]) and show_vp_vpoc

new_l = line.new(bar_index\[1\], poc_price\[1\], bar_index, poc_price\[1\], color=col_vp_vpoc, width=width_vp_vpoc, style=f_get_style(style_vp_vpoc))

array.push(vpoc_lines, new_l)

array.push(vpoc_active, true)

if array.size(vpoc_lines) > 0

for i = 0 to array.size(vpoc_lines) - 1

    if array.get(vpoc_active, i)

        l_ref = array.get(vpoc_lines, i)

        l_y   = line.get_y1(l_ref)

        if high >= l_y and low <= l_y

            array.set(vpoc_active, i, false)

            line.set_x2(l_ref, bar_index)

        else

            line.set_x2(l_ref, bar_index)

// ==================== DRAWING HELPERS ====================

var line l_piv=na, var line l_vxu=na, var line l_vxl=na, var line l_f236=na, var line l_f382=na, var line l_f500=na, var line l_f618=na, var line l_f786=na

var line l_e127u=na, var line l_e161u=na, var line l_e127d=na, var line l_e161d=na, var line l_poc=na, var line l_vah=na, var line l_val=na

var box b_sup=na, var box b_dem=na

f_line(l_in, val, col, w, s, show) =>

line \_l = l_in

if show and not na(val)

    st_idx = na(last_session_start_bar) ? bar_index : last_session_start_bar

    if show_hist_levels

        \_l := line.new(st_idx, val, bar_index, val, color=col, width=w, style=f_get_style(s))

    else

        if na(\_l)

            \_l := line.new(st_idx, val, bar_index, val, color=col, width=w, style=f_get_style(s))

        else

            line.set_xy1(\_l, st_idx, val), line.set_xy2(\_l, bar_index, val), line.set_color(\_l, col), line.set_width(\_l, w), line.set_style(\_l, f_get_style(s))

else if not show_hist_levels and not na(\_l)

    line.delete(\_l), \_l := na

\_l

if barstate.islast or (show_hist_levels and is_new_day)

l_piv   := f_line(l_piv, pivot_val, col_pivot, width_pivot, style_pivot, show_pivot)

l_vxu   := f_line(l_vxu, vix_upper, col_vix_u, width_vix_u, style_vix_u, show_vix_u)

l_vxl   := f_line(l_vxl, vix_lower, col_vix_l, width_vix_l, style_vix_l, show_vix_l)

l_f236  := f_line(l_f236, fib_0236, col_f236, width_f236, style_f236, show_f236)

l_f382  := f_line(l_f382, fib_0382, col_f382, width_f382, style_f382, show_f382)

l_f500  := f_line(l_f500, fib_0500, col_f500, width_f500, style_f500, show_f500)

l_f618  := f_line(l_f618, fib_0618, col_f618, width_f618, style_f618, show_f618)

l_f786  := f_line(l_f786, fib_0786, col_f786, width_f786, style_f786, show_f786)

l_e127u := f_line(l_e127u, fib_1272_ext_u, col_ext127_u, width_ext127_u, style_ext127_u, show_ext127_u)

l_e161u := f_line(l_e161u, fib_1618_ext_u, col_ext161_u, width_ext161_u, style_ext161_u, show_ext161_u)

l_e127d := f_line(l_e127d, fib_1272_ext_d, col_ext127_d, width_ext127_d, style_ext127_d, show_ext127_d)

l_e161d := f_line(l_e161d, fib_1618_ext_d, col_ext161_d, width_ext161_d, style_ext161_d, show_ext161_d)

l_poc   := f_line(l_poc, poc_price, col_vp_poc, width_vp_poc, style_vp_poc, show_vp_poc)

l_vah   := f_line(l_vah, vah_price, col_vah, width_vp_va, style_vp_va, show_vp_va)

l_val   := f_line(l_val, val_price, col_val, width_vp_va, style_vp_va, show_vp_va)

if show_zones and not na(last_session_start_bar) and not na(supply_top)

    if show_hist_levels

        box.new(last_session_start_bar, supply_top, bar_index + 5, supply_bot, bgcolor=col_supply, border_color=color.red)

        box.new(last_session_start_bar, demand_top, bar_index + 5, demand_bot, bgcolor=col_demand, border_color=color.green)

    else

        if na(b_sup)

            b_sup := box.new(last_session_start_bar, supply_top, bar_index + 10, supply_bot, bgcolor=col_supply, border_color=color.red)

            b_dem := box.new(last_session_start_bar, demand_top, bar_index + 10, demand_bot, bgcolor=col_demand, border_color=color.green)

        else

            box.set_lefttop(b_sup, last_session_start_bar, supply_top), box.set_rightbottom(b_sup, bar_index + 10, supply_bot)

            box.set_lefttop(b_dem, last_session_start_bar, demand_top), box.set_rightbottom(b_dem, bar_index + 10, demand_bot)

// ==================== SIGNALS & INDICATORS ====================

vwap_val = ta.vwap(close)

ema9_high = ta.ema(high, ema_len)

ema9_low = ta.ema(low, ema_len)

rsi_val = ta.rsi(close, rsi_length)

[plus_di, minus_di, adx_val] = ta.dmi(di_length, adx_length)

[supertrend, direction] = ta.supertrend(st_factor, st_atr_len)

st_bullish = direction < 0

st_bearish = direction > 0

vbsm_val = ta.ema((close - close[vbsm_len]) / ta.atr(vbsm_len), 3)

vbsm_sig = ta.sma(vbsm_val, 5)

vbsm_bullish = vbsm_val > vbsm_sig and vbsm_val > 0

vbsm_bearish = vbsm_val < vbsm_sig and vbsm_val < 0

all_buy_met = (close > ema9_high) and (close > vwap_val) and (close > pivot_val) and (rsi_val > rsi_buy_level) and (adx_val > adx_threshold) and st_bullish and vbsm_bullish

all_sell_met = (close < ema9_low) and (close < vwap_val) and (close < pivot_val) and (rsi_val < rsi_sell_lev) and (adx_val > adx_threshold) and st_bearish and vbsm_bearish

is_above_channel = close > ema9_high

is_below_channel = close < open and close < ema9_low

is_sideways = close >= ema9_low and close <= ema9_high

barcolor(all_buy_met ? color.rgb(0, 100, 0) : all_sell_met ? color.rgb(139, 0, 0) : is_above_channel ? color.green : is_below_channel ? color.red : color.gray)

// ==================== ATR TRAILING SL (FLAT IN SIDEWAYS) ====================

atr_val = ta.atr(atr_trail_len)

var float trail_sl = na

var int sl_dir = 1

long_stop_prev = nz(trail_sl[1], close - atr_val * atr_mult)

short_stop_prev = nz(trail_sl[1], close + atr_val * atr_mult)

long_stop = close[1] > long_stop_prev ? math.max(close - atr_val * atr_mult, long_stop_prev) : close - atr_val * atr_mult

short_stop = close[1] < short_stop_prev ? math.min(close + atr_val * atr_mult, short_stop_prev) : close + atr_val * atr_mult

if is_sideways

trail_sl := trail_sl\[1\]

else

if sl_dir == 1 and close < long_stop_prev

    sl_dir := -1, trail_sl := short_stop

else if sl_dir == -1 and close > short_stop_prev

    sl_dir := 1, trail_sl := long_stop

else

    trail_sl := sl_dir == 1 ? long_stop : short_stop

// ==================== PLOTS & DASHBOARD ====================

chn_col = all_buy_met ? color.green : all_sell_met ? color.red : is_above_channel ? color.lime : is_below_channel ? color.red : color.gray

p_h = plot(ema9_high, “9 EMA High”, color=chn_col, linewidth=1)

p_l = plot(ema9_low, “9 EMA Low”, color=chn_col, linewidth=1)

fill_col = all_buy_met ? color.new(color.rgb(0, 100, 0), 20) : all_sell_met ? color.new(color.rgb(139, 0, 0), 20) : is_above_channel ? color.new(color.green, 70) : is_below_channel ? color.new(color.red, 70) : color.new(color.gray, 85)

fill(p_h, p_l, color=fill_col, title=“9 EMA Fill”)

// Conditional plot color hides line on chart when show_sl_line is false, keeping table calculation live

sl_color = show_sl_line ? (is_sideways ? color.gray : (sl_dir == 1 ? color.yellow : color.orange)) : color(na)

plot(trail_sl, “ATR Trailing SL”, color=sl_color, linewidth=2)

var table dash = table.new(position.top_right, 2, 5, bgcolor=color.black, border_width=1)

if barstate.islast

table.cell(dash, 0, 0, "Metric", bgcolor=color.gray, text_color=color.white)

table.cell(dash, 1, 0, "Value", bgcolor=color.gray, text_color=color.white)



st_txt = all_buy_met ? "STRONG BUY" : all_sell_met ? "STRONG SELL" : "NEUTRAL"

st_bg  = all_buy_met ? color.rgb(0, 100, 0) : all_sell_met ? color.rgb(139, 0, 0) : color.gray



table.cell(dash, 0, 1, "Signal Status", text_color=color.white)

table.cell(dash, 1, 1, st_txt, bgcolor=st_bg, text_color=color.white)



table.cell(dash, 0, 2, "RSI (>60 Ref)", text_color=color.white)

table.cell(dash, 1, 2, str.tostring(rsi_val, "#.##"), bgcolor=rsi_val > rsi_buy_level ? color.green : rsi_val < rsi_sell_lev ? color.red : color.gray, text_color=color.white)



table.cell(dash, 0, 3, "ADX (>20 Ref)", text_color=color.white)

table.cell(dash, 1, 3, str.tostring(adx_val, "#.##"), bgcolor=

Hello Sir,

I have replied to you on your registered email ID.

Kindly let me know the process as well. Want to add custom indicator in tv.dhan.

Please advise to me on adding own indicator on dhan chart.

Hey @deepaklost,

Great to have you back on the community after a while! Hope things have been good.

For adding Custom indicator you can check the same under https://charts.dhan.co/ only, refer below snapshot for Indicator section.

image

Hey @Rajiv_Singh14,

Welcome To MadeForTrade !

Customised Indicator is now available on ChartScript editor under Indicator section at https://charts.dhan.co/. Support for all languages.

Here is the guide for scripting https://tradingcharts.co/scripting