This strategy utilizes the RSI indicator to measure price momentum and determines entry timings by calculating the standard deviation of changes in RSI. It enters a long position when the RSI momentum exceeds the standard deviation threshold and is less than the previous momentum multiplied by an exhaustion factor, and enters a short position under the opposite conditions. The strategy uses limit orders for exit, controlling risk by setting profit target and stop loss ticks. The strategy executes on every price tick to capture all potential price movements.
This strategy utilizes RSI momentum and standard deviation thresholds to perform reversal trading in a high-frequency environment. By introducing an exhaustion factor and limit order exit, the strategy is able to capture trading opportunities brought by price movements while controlling risk. However, the strategy still needs further optimization in actual application, such as introducing more indicators, optimizing parameter settings, introducing position management and trend filtering, etc., to improve the stability and profitability of the strategy.
/*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)