
最初のの突破-ストップまたはクローズアップ自動平仓戦略は,取引日の最初の線の高低点を基に潜在的な入場信号を識別する日内取引戦略である.この戦略は,価格が最初の線の範囲を突破した時の動きを捉え,その日の終わりまでにまたは停止の位置に触れたときに平仓を立て,短期的な波動の利益を実現する.この戦略は簡潔に設計されており,日中の価格動向の初期方向的な突破に焦点を当てており,明確なストップ・ピースポジション規則を設け,リスクを効果的に制御しています.
この戦略の核心原則は,取引日の初期段階の価格動力と突破シグナルを利用して,その後の動きを予測することである.具体的操作の流れは以下の通りである.
変数による戦略tradeTaken“日”回の取引のみを保証し,tradeDirection現在の取引方向を記録する ((1は多,-1は空),取引状態とストップ・ロスの条件を効果的に管理する.
最初の突破 - ストップまたはクローズアップ自動平仓戦略は,市場開封後の方向的な突破を捕捉して利益を得る簡潔で効率的な日内取引方法である.この戦略の主要な優点は,操作が簡単で,リスクが制御可能であり,日内トレーダーが使用するものである.しかし,戦略には偽の突破リスクと単一の参照点の限界もある.フィルタリング条件を追加し,ストップ・ロスの仕組みを最適化し,市場環境分析などと組み合わせることで,戦略の安定性と収益性を大幅に向上させることができる.量化取引の分野に入りたい新手にとって,これは良い出発点戦略であり,より複雑な取引システムの基礎構成要素としても使用できます.最も重要なことは,トレーダーは,自らのリスク承受能力と取引目標に基づいて,戦略を適切に調整し,最適化して,最適な取引効果を達成することです.
/*backtest
start: 2025-03-28 00:00:00
end: 2025-03-31 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("First Candle Breakout - Close on SL or EOD", overlay=true)
// User Inputs
startHour = input(9, "Start Hour (Exchange Time)")
startMinute = input(15, "Start Minute (Exchange Time)")
endHour = input(15, "End Hour (Exchange Time)") // Market closing hour
endMinute = input(30, "End Minute (Exchange Time)")
// Variables to store the first candle's high & low
var float firstCandleHigh = na
var float firstCandleLow = na
var bool tradeTaken = false // Ensures only one trade per day
var int tradeDirection = 0 // 1 for long, -1 for short
// Identify first candle's high & low
if (hour == startHour and minute == startMinute and bar_index > 1)
firstCandleHigh := high
firstCandleLow := low
tradeTaken := false // Reset trade flag at start of day
tradeDirection := 0 // Reset trade direction
// Buy condition: Close above first candle high AFTER the first candle closes
longCondition = not na(firstCandleHigh) and close > firstCandleHigh and not tradeTaken and hour > startHour
if (longCondition)
strategy.entry("Buy", strategy.long, comment="Buy")
tradeTaken := true // Mark trade as taken
tradeDirection := 1 // Mark trade as long
// Sell condition: Close below first candle low AFTER the first candle closes
shortCondition = not na(firstCandleLow) and close < firstCandleLow and not tradeTaken and hour > startHour
if (shortCondition)
strategy.entry("Sell", strategy.short, comment="Sell")
tradeTaken := true // Mark trade as taken
tradeDirection := -1 // Mark trade as short
// Stop loss for long trades (first candle low)
if (tradeDirection == 1 and close <= firstCandleLow)
strategy.close("Buy", comment="SL Hit")
// Stop loss for short trades (first candle high)
if (tradeDirection == -1 and close >= firstCandleHigh)
strategy.close("Sell", comment="SL Hit")
// Close trade at end of day if still open
if (tradeTaken and hour == endHour and minute == endMinute)
strategy.close_all(comment="EOD Close")