
この戦略は5分間の開盤価格の上昇と下落に基づいて取引決定を行い,二段階の跨差ブレイクを使用して,大きな価格変動を震動傾向で捉えることを目的として,異なる触発条件を設定します.
戦略は,毎日2時間5分間のK線の開場価格に基づいて,現在の5分間のK線の上昇率を計算し,上昇率が設定された第1段階の幅を超えると,対応した買入または販売の決定を行います.同時に,ストップ・ロスの設定と,ストップ・ポジションの退出の決定を行います.
ストップがトリガーされた場合,落が拡大し,第2段階の跨界のトリガー条件を超えると,以前の注文を撤回し,第2段階の跨界の下での新しい買取または販売指示を使用し,ストップとストップを追跡し続けます.
2段階の幅の設定により,変動の際の部分的なノイズをフィルターし,より大幅な価格変動時にのみ取引することができる.また,2段階の幅のアクティベーションは,止損が頻繁に引き起こされる状況を減らすことができる.
対策として
この戦略は,2段階の跨度突破によって価格の波動を捕捉し,震動状況で効率的に騒音をフィルターする.戦略コンセプトはシンプルで明快で,パラメータの最適化により良い効果が得られる.次のステップは,トレンド判断指標と組み合わせて考えられ,トレンド状況で戦略の優位性を発揮することができる.全体的に,戦略の構想は新鮮で,突破原理を効果的に利用し,最適化調整後に良い効果が得られる.
/*backtest
start: 2023-10-01 00:00:00
end: 2023-10-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Auto Entry Bot", overlay=true)
// Define input for the stop loss and take profit levels
stopLossPips = input.int(200, title="Stop Loss Pips", minval=1)
takeProfitPips = input.int(400, title="Take Profit Pips", minval=1)
// Calculate the percentage change from the 5-minute opening candle at 2:00 AM
var float openPrice = na
if (hour == 2 and minute == 0)
openPrice := open
percentageChange = (close - openPrice) / openPrice * 100
// Track the cumulative percentage change
var float cumulativeChange = 0
// Define input for the percentage change trigger
triggerPercentage1 = input.float(0.25, title="Percentage Change Trigger (%)", minval=0.01, step=0.01)
triggerPercentage2 = input.float(0.35, title="Additional Trigger Percentage (%)", minval=0.01, step=0.01)
// Check for price change trigger
if (percentageChange >= triggerPercentage1)
// Sell signal
strategy.entry("Sell", strategy.short)
strategy.exit("ExitSell", loss=stopLossPips, profit=takeProfitPips)
cumulativeChange := 0 // Reset cumulative change after a trade
if (percentageChange <= -triggerPercentage1)
// Buy signal
strategy.entry("Buy", strategy.long)
strategy.exit("ExitBuy", loss=stopLossPips, profit=takeProfitPips)
cumulativeChange := 0 // Reset cumulative change after a trade
// If the price keeps hitting stop loss, activate the second trigger
if (strategy.position_size < 0 and percentageChange <= -triggerPercentage2)
strategy.cancel("Sell") // Cancel previous sell order
strategy.entry("Sell2", strategy.short)
strategy.exit("ExitSell2", loss=stopLossPips, profit=takeProfitPips)
cumulativeChange := 0 // Reset cumulative change after a trade
if (strategy.position_size > 0 and percentageChange >= triggerPercentage2)
strategy.cancel("Buy") // Cancel previous buy order
strategy.entry("Buy2", strategy.long)
strategy.exit("ExitBuy2", loss=stopLossPips, profit=takeProfitPips)
cumulativeChange := 0 // Reset cumulative change after a trade