TradingView
Bitduke
17 de Dez de 2019 23:08

Simple RSI Strategy Buy/Sell at a certain level 

Descrição

Simple Strategy based on RSI, using overbought or oversold levels, defined by us, sell or buy an asset.
Backtest: ETHUSD (Bitmex) - 3h
Comentários
csevinctav
Thanks. How can I add take profit and stop loss to this strategy?
Bitduke
@csevinctav, I think it will be better to create the extended version with SL/TP, thanks
csevinctav
@Bitduke, It would be great. i can't wait to try. Thanks for everything
Bitduke
csevinctav
@Bitduke, thanks. I will try now.
Swing_Trader_
Your entries should be reversed shouldn't they?
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(33, title="oversold value")
sellRsi = rsi(close, 14) > overbought
buyRsi = rsi(close, 14) < oversold

barcolor(sellRsi ? color.red : na)
barcolor(buyRsi ? color.green : na)

strategy.entry("Buy Signal", strategy.long, when = buyRsi)
strategy.entry("Sell Signal", strategy.short, when = sellRsi)
kindBird21
Shouldn't you buy when stock is oversold and sell when overbought?
Joeanucha
thanks!
Mais