Create a Trading View Pine Script Statergy for Following Indicator: //@version=5…
- User
Create a Trading View Pine Script Statergy for Following Indicator: //@version=5 indicator("Inside Candle on VWAP Cross with Custom Wick Filter", overlay=true)
// Input to show/hide inside candles with mother candle wick greater than the specified percentage showWickFilter = input.bool(true, title="Hide Inside Candle with Mother Candle Wick > Custom Percentage") wickPercentage = input.float(20, title="Wick Percentage", minval=0, maxval=100)
// VWAP calculation vwap = ta.vwap(close)
// Identify cross crossAbove = ta.crossover(close, vwap) crossBelow = ta.crossunder(close, vwap)
// Inside Candle logic for the next candle isInsideCandle = (high <= high[1] and low >= low[1])
// Mother candle wick percentage calculation based on color motherCandleGreen = close[1] > open[1] motherCandleWickPct = motherCandleGreen ? ((high[1] - close[1]) / (high[1] - low[1]) * 100) : ((open[1] - low[1]) / (high[1] - low[1]) * 100) hideInsideCandle = showWickFilter and motherCandleWickPct > wickPercentage
// Plot inside candles on VWAP cross with wick filter plotshape(series=crossAbove[1] and isInsideCandle and not hideInsideCandle, location=location.belowbar, color=color.green, style=shape.labelup, text="IC Up", title="Inside Candle Bullish Cross") plotshape(series=crossBelow[1] and isInsideCandle and not hideInsideCandle, location=location.abovebar, color=color.red, style=shape.labeldown, text="IC Down", title="Inside Candle Bearish Cross")
// Plot VWAP plot(vwap, color=color.blue, title="VWAP")
- Assistant