
この戦略は,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)