Home Article Put call ratio pcr Put call ratio pcr Software Technique Web Technique All Computer Language and Computer Language Practice Computer Educa April 15, 2026 0 Comments Share: Facebook Twitter Google+ Pinterest Whatsapp TREDING //@version=5 indicator("Smart PCR Style Table (Move Option)", overlay=true) // ==== POSITION INPUT ==== pos = input.string("top_center", "Table Position", options = ["top_left","top_center","top_right","middle_left","middle_center","middle_right","bottom_left","bottom_center","bottom_right"]) // ==== POSITION MAP ==== table_pos = pos == "top_left" ? position.top_left : pos == "top_center" ? position.top_center : pos == "top_right" ? position.top_right : pos == "middle_left" ? position.middle_left : pos == "middle_center" ? position.middle_center : pos == "middle_right" ? position.middle_right : pos == "bottom_left" ? position.bottom_left : pos == "bottom_center" ? position.bottom_center : position.bottom_right // ==== INDICATORS ==== rsi = ta.rsi(close, 14) [macdLine, signalLine, _] = ta.macd(close, 12, 26, 9) vwap = ta.vwap(close) ema = ta.ema(close, 20) // ==== LOGIC ==== bullish = close > vwap and close > ema and rsi > 55 and macdLine > signalLine bearish = close < vwap and close < ema and rsi < 45 and macdLine < signalLine // ==== STRENGTH ==== bull_strength = bullish ? math.round((rsi - 50) / 5) : 0 bear_strength = bearish ? math.round((50 - rsi) / 5) : 0 bull_strength := math.min(math.max(bull_strength, 0), 10) bear_strength := math.min(math.max(bear_strength, 0), 10) // ==== TABLE ==== var table tbl = table.new(table_pos, 10, 2, border_width=1) // update on last bar if barstate.islast for i = 1 to 10 // CALL table.cell(tbl, i-1, 0, str.tostring(i), bgcolor = i == bull_strength ? color.green : color.gray) // PUT table.cell(tbl, i-1, 1, "-" + str.tostring(i), bgcolor = i == bear_strength ? color.red : color.gray) // ==== SIGNAL ==== var label sig = na if bullish and not bullish[1] label.delete(sig) sig := label.new(bar_index, high, "CALL BUY", color=color.green, textcolor=color.white) if bearish and not bearish[1] label.delete(sig) sig := label.new(bar_index, low, "PUT BUY", color=color.red, textcolor=color.white) Copy Copied Text:
No comments