//@version=6 indicator("RSI TMA", overlay=true) // Arrows on the main chart (overlay=true) // Input parameters rsiLength = input.int(2, title="RSI Length") rsiPrice = input.source(close, title="RSI Price") halfLength = input.int(2, title="Half Length") devPeriod = input.int(100, title="Deviation Period") deviations = input.float(0.7, title="Deviations") noDellArr = input.bool(false, title="No Delete Arrows") arrOtstup = input.int(0, title="Arrow Offset") arrUpColor = input.color(color.lime, title="Arrow Up Color") arrDnColor = input.color(color.red, title="Arrow Down Color") alertsMessage = input.bool(false, title="Alerts Message") alertsSound = input.bool(false, title="Alerts Sound") alertsEmail = input.bool(false, title="Alerts Email") alertsMobile = input.bool(false, title="Alerts Mobile") signalBar = input.int(0, title="Signal Bar") ...
//@version=5
indicator("Cumulative Effort & Result Index (CERI) + Buy/Sell Signals", overlay=false)
// Effort = Volume
effort = volume
// Result = Price Movement (close - open)
result = close - open
// Effort × Result
effort_result = effort * result
// Cumulative Effort-Result Index
ceri = ta.cum(effort_result)
// Smoothing
smoothLength = input.int(14, "Smoothing Length")
ceri_smoothed = ta.ema(ceri, smoothLength)
// Plots
plot(ceri, "CERI (Raw)", color=color.new(color.aqua, 0), linewidth=2)
plot(ceri_smoothed, "CERI (Smoothed)", color=color.new(color.yellow, 0), linewidth=2)
histColor = effort_result >= 0 ? color.new(color.green, 0) : color.new(color.red, 0)
plot(effort_result, "Effort × Result Histogram", style=plot.style_histogram, color=histColor)
// Slope
ceri_up = ceri_smoothed > ceri_smoothed[1]
ceri_down = ceri_smoothed < ceri_smoothed[1]
// Histogram color shift
green_now = effort_result >= 0
green_prev = effort_result[1] >= 0
// Buy = histogram red -> green + ceri slope up
buySignal = (not green_prev and green_now) and ceri_up
// Sell = histogram green -> red + ceri slope down
sellSignal = (green_prev and not green_now) and ceri_down
// Plot Buy/Sell Labels (fixed syntax)
plotshape(buySignal, title="Buy", style=shape.labelup, color=color.green, text="BUY", size=size.small, location=location.bottom)
plotshape(sellSignal, title="Sell", style=shape.labeldown, color=color.red, text="SELL", size=size.small, location=location.top)
Comments
Post a Comment