
이 전략은 시장에서 주문 블록을 식별하여 잠재적인 가격 반전 지점을 예측하는 기관 주문 흐름에 기초한 지능형 거래 시스템입니다. 이 시스템은 3단계 목표 포지션을 통한 포지션 관리를 최적화하고 수익을 극대화하기 위해 동적 하부 창고 관리 솔루션을 채택합니다. 전략의 핵심은 기관 거래 행동에 의해 생성된 가격 추적을 포착하고 최고점과 최저점에 대한 통계적 분석을 통해 중요한 가격 수준을 식별하는 것입니다.
이 전략은 몇 가지 핵심 요소를 기반으로 합니다.
이 전략은 기관 주문 흐름 분석과 역동적인 창고 관리를 통해 완전한 거래 시스템을 구축합니다. 주문 블록을 식별하고 다단계 손익 중단 설정을 통해 대규모 자본 운영에 대한 기회를 포착하고 효과적인 위험 관리를 달성할 수 있습니다. 실제 거래에서는 거래자가 시장 환경 선택에 주의를 기울이고 특정 상황에 맞게 매개변수 설정을 조정하는 것이 좋습니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Institutional Order Flow Strategy", overlay=true)
// Input settings
inputSession = input("0930-1600", "Trading Session") // Trading session
lookbackPeriod = input.int(20, "Order Block Lookback Period", minval=1) // Lookback for Order Blocks
target1Pct = input.float(0.5, "Target 1 (% move)", step=0.1, minval=0.1) // First profit target
target2Pct = input.float(1.0, "Target 2 (% move)", step=0.1, minval=0.1) // Second profit target
target3Pct = input.float(1.5, "Target 3 (% move)", step=0.1, minval=0.1) // Third profit target
// Order Block identification
highestHigh = ta.highest(high, lookbackPeriod)
lowestLow = ta.lowest(low, lookbackPeriod)
orderBlockBuy = ta.valuewhen(close[1] < open[1] and close > open, highestHigh, 0)
orderBlockSell = ta.valuewhen(close[1] > open[1] and close < open, lowestLow, 0)
// Entry logic
inSession = true
longCondition = close > orderBlockBuy and inSession
shortCondition = close < orderBlockSell and inSession
// Strategy entries
if longCondition
strategy.entry("Long", strategy.long)
if shortCondition
strategy.entry("Short", strategy.short)
// Calculate targets for scaling out
longTarget1 = strategy.position_avg_price + strategy.position_avg_price * target1Pct / 100
longTarget2 = strategy.position_avg_price + strategy.position_avg_price * target2Pct / 100
longTarget3 = strategy.position_avg_price + strategy.position_avg_price * target3Pct / 100
shortTarget1 = strategy.position_avg_price - strategy.position_avg_price * target1Pct / 100
shortTarget2 = strategy.position_avg_price - strategy.position_avg_price * target2Pct / 100
shortTarget3 = strategy.position_avg_price - strategy.position_avg_price * target3Pct / 100
// Exit logic with scaling out
if strategy.position_size > 0
strategy.exit("Target 1", from_entry="Long", limit=longTarget1, qty_percent=50)
strategy.exit("Target 2", from_entry="Long", limit=longTarget2, qty_percent=30)
strategy.exit("Target 3", from_entry="Long", limit=longTarget3, qty_percent=20)
if strategy.position_size < 0
strategy.exit("Target 1", from_entry="Short", limit=shortTarget1, qty_percent=50)
strategy.exit("Target 2", from_entry="Short", limit=shortTarget2, qty_percent=30)
strategy.exit("Target 3", from_entry="Short", limit=shortTarget3, qty_percent=20)
// Visualize Order Blocks
plot(orderBlockBuy, "Order Block Buy", color=color.green, linewidth=2, style=plot.style_line)
plot(orderBlockSell, "Order Block Sell", color=color.red, linewidth=2, style=plot.style_line)