#trading #strategy #RSI #technicalanalysis
![[Pasted image 20230328191157.png]]
# Rules
- When the 3-day RSI is below 30, we go long at the close.
- When the 3-day RSI crosses above 70, we sell the rip at the close.
```js
//@version=5
strategy("Rip Strategy", overlay=true)
// Inputs
rsi_length = input(3, title="RSI Length")
rsi_buy_level = input(30, title="Buy Level")
rsi_sell_level = input(70, title="Sell Level")
// RSI
rsi = ta.rsi(close, rsi_length)
// Buy signal
buy_signal = rsi < rsi_buy_level
// Sell signal
sell_signal = rsi > rsi_sell_level
// Strategy entry and exit
if buy_signal
strategy.entry("Buy", strategy.long)
if sell_signal
strategy.close("Buy")
```