Professional Documents
Culture Documents
Liquidity Buy Sell Premium
Liquidity Buy Sell Premium
// Define your calculations for Nifty and Bank Nifty liquidity, premium, and delta
// Replace these with your specific formulas or calculations
niftyLiquidity = input(0, title="Nifty Liquidity")
niftyPremium = input(0, title="Nifty Premium")
niftyDelta = input(0, title="Nifty Delta")
// Define buy and sell thresholds for Nifty and Bank Nifty
niftyBuyThreshold = input(1, title="Nifty Buy Threshold")
niftySellThreshold = input(-1, title="Nifty Sell Threshold")
// Indicator code
T1 = time(timeframe.period, "0915-0916")
T2 = time(timeframe.period, "0915-1530")
Y = bar_index
Z1 = valuewhen(T1, bar_index, 0)
L = Y-Z1 + 1
SSPV = 0.00
SSNV = 0.00
pdw=0.00
ndw=0.00
total_w=0.00
for i = 1 to L-1
total_w:=high[i]-low[i]
positive = close[i]-low[i]
negative = high[i]- close[i]
pdw := (positive/total_w)*100
ndw := (negative/total_w)*100
if barstate.islast
table.cell(sDisplay, 0, 0, "Today's Volume : " + tostring(total_v), text_color
= color.white, text_size=size.large, bgcolor=color.aqua)
table.cell(sDisplay, 0, 1, "Buyers Volume: " +tostring(round(SSPV)) ,
text_color = color.white, text_size=size.large, bgcolor=color.green)
table.cell(sDisplay, 0, 2, "Sellers Volume: " +tostring(round(SSNV)) ,
text_color = color.white, text_size=size.large, bgcolor=color.red)
table.cell(sDisplay, 0, 3, "Buyers Strength: " +tostring(round(Pos)) + "%" ,
text_color = color.white, text_size=size.large, bgcolor=color.green)
table.cell(sDisplay, 0, 4, "Sellers Strength: " +tostring(round(Neg)) + "%" ,
text_color = color.white, text_size=size.large, bgcolor=color.red)
// Plot buy and sell signals on the chart for Nifty and Bank Nifty
niftyBuySignal = niftySignal > niftyBuyThreshold
niftySellSignal = niftySignal < niftySellThreshold