Mean Reversion v6. Buys when price < Lower BB & RSI < 30.
//@version=6
strategy("RSI + BB Reversion [Codon.pro]", overlay=true, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
rsi_len = input.int(14, "RSI Length")
rsi_oversold = input.int(30, "RSI Oversold Level")
bb_len = input.int(20, "BB Length")
bb_mult = input.float(2.0, "BB Multiplier")
rsi = ta.rsi(close, rsi_len)
[middle, upper, lower] = ta.bb(close, bb_len, bb_mult)
longCondition = close < lower and rsi < rsi_oversold
exitCondition = close > middle
if longCondition
strategy.entry("Reversion Buy", strategy.long)
if exitCondition
strategy.close("Reversion Buy")
p1 = plot(upper, color=color.new(color.red, 50))
p2 = plot(lower, color=color.new(color.green, 50))
fill(p1, p2, color=color.new(color.blue, 90))Enhance your trading workflow with these professional tools and platforms.
Keep 100% of the first $12.5K. EOD Drawdown and flexible evaluation types to suit your style.
Secure, reliable, and fully licensed. The best crypto experience for US traders.
The professional's choice for futures trading with minimal slippage and stable API.
Mirror the positions of top-tier traders instantly without writing code.