该策略是一种适用于砖块K线的Stochastic RSI交易策略。它使用Stochastic RSI指标的K线和D线的金叉死叉来产生买入和卖出信号。该策略专门用于砖块K线,可以有效过滤市场噪音,识别趋势。
该策略的交易信号主要基于Stochastic RSI指标,该指标结合了RSI指标和Stochastic oscillator指标的优点。
首先,计算一段时间内的RSI值,然后再根据RSI值计算Stochastic RSI。Stochastic RSI包含两个线:
当K线从下向上突破D线时,产生买入信号;当K线从上向下突破D线时,产生卖出信号。
此外,该策略仅用于砖块K线图,可以过滤掉市场噪音,识别趋势方向。砖块K线通过设置价格变动阈值构建K线,能够过滤正常市场波动对交易的影响。
该策略主要优势如下:
Stochastic RSI结合RSI和Stochastic优点,信号相对准确
砖块K线图可滤除噪音,识别趋势
K线和D线交易规则简单清晰
参数较少,便于优化
可适用于不同周期进行镖形交易
该策略也存在以下风险:
误判风险导致亏损
优化Stochastic RSI的参数
结合其他指标进行确认
趋势反转时错误持仓被套牢
砖块K线范围设置不当失去效果
过于频繁交易增加交易费用和滑点成本
该策略可从以下几个方面进行优化:
优化Stochastic RSI的参数,找到最佳配置
优化砖块K线的参数设置
加入止损止盈策略
结合其他指标进行信号过滤
应用机器学习算法提升交易时机判断
根据市场情况调整参数
进行参数自动优化测试
整体来说,该砖块K线Stochastic RSI交易策略结合了两种指标的优势,使用砖块K线进行滤波,可以有效识别趋势方向。该策略较简单易行,但可通过参数优化、止损策略等进行改进以适应市场的变化。如果使用得当,该策略可以成为构建量化交易系统的基础选择。
/*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)