// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © AI_PIPS //@version=6 indicator("AIPIPS Sentiment Liquidity Dashboard", overlay=false) emaFast = input.int(21, "Fast EMA", minval=1) emaSlow = input.int(50, "Slow EMA", minval=1) rangeLen = input.int(20, "Range reference", minval=5) liquidityBandPct = input.float(0.3, "Liquidity band %", step=0.05) emaF = ta.ema(close, emaFast) emaS = ta.ema(close, emaSlow) trendScore = emaF > emaS ? 1 : emaF < emaS ? -1 : 0 rangeHigh = ta.highest(high, rangeLen) rangeLow = ta.lowest(low, rangeLen) band = (rangeHigh - rangeLow) * liquidityBandPct * 0.01 nearTop = high >= rangeHigh - band nearBottom = low <= rangeLow + band liquidityScore = nearTop ? -1 : nearBottom ? 1 : 0 bullishFVG = low[1] > high[2] bearishFVG = high[1] < low[2] fvgScore = bullishFVG ? 1 : bearishFVG ? -1 : 0 sentimentScore = trendScore + liquidityScore + fvgScore var table dash = table.new(position.top_right, 2, 4, frame_color=color.new(color.gray, 60), frame_width=1) if barstate.islastconfirmedhistory table.cell(dash, 0, 0, "Metric", text_color=color.yellow, bgcolor=color.new(color.black, 0)) table.cell(dash, 1, 0, "Score", text_color=color.yellow, bgcolor=color.new(color.black, 0)) table.cell(dash, 0, 1, "Trend", text_color=color.white) table.cell(dash, 1, 1, str.tostring(trendScore), text_color=trendScore > 0 ? color.green : trendScore < 0 ? color.red : color.gray) table.cell(dash, 0, 2, "Liquidity", text_color=color.white) table.cell(dash, 1, 2, str.tostring(liquidityScore), text_color=liquidityScore > 0 ? color.green : liquidityScore < 0 ? color.red : color.gray) table.cell(dash, 0, 3, "FVG", text_color=color.white) table.cell(dash, 1, 3, str.tostring(fvgScore), text_color=fvgScore > 0 ? color.green : fvgScore < 0 ? color.red : color.gray) plot(sentimentScore, title="Sentiment score", color=color.new(color.purple, 0), linewidth=2, style=plot.style_histogram)