该策略利用RSI指标衡量价格动量,通过计算RSI变化的标准差来确定进场时机。在RSI动量超过标准差阈值且小于前一刻动量乘以衰竭因子时开多仓,反之开空仓。该策略使用限价单平仓,通过设置止盈和止损点数来控制风险。策略在每个价格变动时执行,以捕捉所有潜在的价格波动。
该策略利用RSI动量和标准差阈值,在高频环境下进行反转交易。通过引入衰竭因子和限价单平仓,策略能够在控制风险的同时捕捉价格波动带来的交易机会。但是,策略在实际应用中还需要进一步优化,如引入更多指标、优化参数设置、引入仓位管理和趋势过滤等,以提高策略的稳定性和盈利能力。
/*backtest
start: 2024-03-01 00:00:00
end: 2024-03-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("MCOTs Intuition Strategy", overlay=true, default_qty_type=strategy.fixed, default_qty_value=1, initial_capital=50000, calc_on_every_tick=true)
// Input for RSI period
rsiPeriod = input(14, title="RSI Period")
// Input for standard deviation multiplier
stdDevMultiplier = input(1.0, title="Standard Deviation Multiplier")
// Input for exhaustion detection
exhaustionMultiplier = input(1.5, title="Exhaustion Multiplier")
// Input for profit target and stop loss in ticks
profitTargetTicks = input(8, title="Profit Target (ticks)")
stopLossTicks = input(32, title="Stop Loss (ticks)")
// Calculate RSI
rsiValue = ta.rsi(close, rsiPeriod)
// Calculate standard deviation of RSI changes
rsiStdDev = ta.stdev(ta.change(rsiValue), rsiPeriod)
// Calculate momentum
momentum = ta.change(rsiValue)
// Conditions for entering a long position
longCondition = momentum > rsiStdDev * stdDevMultiplier and momentum < momentum[1] * exhaustionMultiplier
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("Take Profit Long", "Long", limit=close + profitTargetTicks * syminfo.mintick)
strategy.exit("Stop Loss Long", "Long", stop=close - stopLossTicks * syminfo.mintick)
// Conditions for entering a short position
shortCondition = momentum < -rsiStdDev * stdDevMultiplier and momentum > momentum[1] * exhaustionMultiplier
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("Take Profit Short", "Short", limit=close - profitTargetTicks * syminfo.mintick)
strategy.exit("Stop Loss Short", "Short", stop=close + stopLossTicks * syminfo.mintick)
// Plotting RSI value for reference
plot(rsiValue, title="RSI", color=color.blue)