Skip to content
All library documents

RSI Threshold Entries with Percentage-Based Stops and Targets

Article TradingView scripts

Summary

This strategy enters long when a 14-period RSI rises above the overbought threshold and short when RSI falls below the oversold threshold. The defaults are 70 and 30, respectively. It also converts percentage-based stop and target settings into price ticks using the average entry price and minimum tick size, then submits an exit order for the full position. The script includes configurable dates for restricting the backtest and closes open positions outside that period.

The document describes an example backtest on an ETH perpetual market at a 30-minute interval, but gives no performance figures. There is an apparent labeling inconsistency: the code assigns a 2% value to the variable named stop loss and 10% to the variable named take profit, yet passes them to the exit function's profit and loss fields in the opposite order. This can reverse the intended stop and target distances. The rules also enter on RSI being beyond a level, rather than requiring a fresh threshold cross, so positions may be repeatedly signaled while the condition persists.

Key ideas

  • The strategy enters long above the RSI overbought threshold and short below the oversold threshold.
  • Exit distances are converted from percentages of average entry price into instrument ticks.
  • Backtesting can be limited to a chosen date and time interval, with positions closed outside it.
  • The labels for stop loss and take profit appear reversed relative to the exit function arguments, warranting careful verification.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.