Simple RSI Strategy Buy/Sell at a certain level
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Bitduke

//@version=4
strategy("Simple RSI Buy/Sell at a level", shorttitle="Simple RSI Strategy", overlay=true,calc_on_every_tick=false,pyramiding=0, default_qty_type=strategy.cash,default_qty_value=1000, currency=currency.USD, initial_capital=1000,commission_type=strategy.commission.percent, commission_value=0.075)
overbought = input(70, title="overbought value")
oversold = input(30, title="oversold value")
myrsi = rsi(close, 14) > overbought
myrsi2 = rsi(close, 14) < oversold

barcolor(myrsi ? color.black : na)
barcolor(myrsi2 ? color.blue : na)

strategy.entry("Buy Signal",strategy.long, when = myrsi)
strategy.entry("Sell Signal",strategy.short, when = myrsi2)