0bps

Strategy vault / Machine learning

Renko Stochastic RSI Trading Strategy

This is a Stochastic RSI trading strategy designed for use on Renko charts. It generates buy and sell signals using the crossover and crossunder of Stochastic RSI K and D lines. The strategy is specialized for Renko…

Author
ChaoZhang
Complexity
Starter · 31 lines
Parameters
4
Backtest bar
3h · intraday
Tested on
BTC/USDT · futures

Overview

This is a Stochastic RSI trading strategy designed for use on Renko charts. It generates buy and sell signals using the crossover and crossunder of Stochastic RSI K and D lines. The strategy is specialized for Renko charts and can effectively filter market noise and identify trends.

Strategy Logic

The trading signals are primarily based on the Stochastic RSI indicator, which combines the advantages of RSI and Stochastic oscillator.

First, the RSI value over a period is calculated, then Stochastic RSI is computed based on the RSI values. Stochastic RSI contains two lines:

  • K line: Moving average of RSI values over a period, represents the fast Stochastic RSI line

  • D line: Moving average of the K line, represents the slow Stochastic RSI line

When K line crosses above D line, a buy signal is generated. When K line crosses below D line, a sell signal is generated.

In addition, this strategy is only applied on Renko charts, which filters market noise by constructing bars based on price change threshold, identifying trend direction.

Advantage Analysis

The main advantages of this strategy:

  1. Stochastic RSI combines the strengths of RSI and Stochastic, relatively accurate signals

  2. Renko charts filter out noise and identify trends

  3. K and D line trading rules are simple and clear

  4. Fewer parameters, easy to optimize

  5. Applicable for scalping across different timeframes

Risks and Solutions

The risks associated with this strategy:

  1. Misjudgement leading to losses

    • Optimize Stochastic RSI parameters

    • Incorporate other indicators for confirmation

  2. Wrong direction when trend reverses leading to being trapped

    • Implement stop loss and take profit
  3. Improper Renko chart range setting loses effectiveness

    • Test and optimize parameters for Renko charts
  4. High trading frequency increases transaction costs and slippage

    • Adjust Renko chart settings to reduce trading frequency

Improvement Directions

Some ways to improve the strategy:

  1. Optimize Stochastic RSI parameters to find best configurations

  2. Optimize Renko chart parameter settings

  3. Add stop loss and take profit

  4. Filter signals with additional indicators

  5. Apply machine learning models to enhance trade timing

  6. Adjust parameters based on market conditions

  7. Conduct automatic parameter optimization testing

Conclusion

In summary, this Renko Stochastic RSI trading strategy combines the strengths of two indicators and uses Renko charts for filtration, effectively identifying trend direction. The strategy is relatively simple but can be improved via parameter optimization, stop loss strategies etc. to adapt to changing markets. If used properly, this strategy can serve as a fundamental selection for building quantitative trading systems.

Parameters

NameDefaultWhat it controls
v_input_120lengthRSI
v_input_23lengthStoch
v_input_35smoothK
v_input_42smoothD

Source Pine Script

/*backtest
start: 2023-08-18 00:00:00
end: 2023-09-17 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
//Author=OldManCryptobi
//Portions of code are from: HPotter's "Stochastic RSI Strategy" https://www.tradingview.com/script/Vc37EPdG-Stochastic-RSI-Strategy/
//This is designed for Renko Charts Only
//Use with Renko Stochastic RSI Alerts to add pop-up alerts & sounds
strategy("Renko Stochastic RSI Strat", overlay=true, pyramiding = 0, initial_capital=100, commission_type=strategy.commission.percent, commission_value=0.0675)

Source = close
lengthRSI = input(20, minval=1), lengthStoch = input(3, minval=1)
smoothK = input(5, minval=1), smoothD = input(2, minval=1)
rsi1 = rsi(Source, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
plot(k, color= aqua, linewidth=2, transp=0)
plot(d, color= fuchsia, linewidth=2, transp=0)

longCondition = crossover(k,d)
if (longCondition)
    strategy.entry("Long", strategy.long)
    
shortCondition = crossunder(k,d)
if (shortCondition)
    strategy.entry("Short", strategy.short)

Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-18. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.

Build this with AgenKit

A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Renko-Stochastic-RSI-Trading-Strategy.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. Get tests, backtest, risk controls and a paper-trading switch

Understand it first

Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.

Related specs

esc

Try , , or .

↑↓ move↵ open