
이 전략은 시장 가격 형태를 인식하는 것에 기반한 정량 거래 시스템으로, 주로 123비트 역전 형태를 식별하여 시장의 잠재적 역전 기회를 포착한다. 이 전략은 다중 조건 검증을 통해 거래의 정확성을 높이기 위해 동적 포지션 기간 관리와 이동 평균 필터를 결합한다. 이 전략은 정확한 수학적 모델을 사용하여 입점을 정의하고 200 일평선을 보조적인 퇴출 조건으로 사용하여 완전한 거래 시스템을 형성한다.
전략의 핵심 논리는 가격 형태를 인식하는 데 기반하며, 다음과 같은 핵심 요소를 포함합니다.
이 전략은 엄격한 형상 식별과 완벽한 위험 제어 시스템을 통해 거래자에게 신뢰할 수있는 시장 역전 포착 도구를 제공합니다. 제한 사항이 있지만, 지속적인 최적화와 적절한 파라미터 조정으로이 전략은 다양한 시장 환경에서 안정적인 성능을 유지할 수 있습니다. 거래자는 실제 적용에서 시장 경험을 결합하여 전략에 대한 타겟 조정을 수행하여 더 나은 거래 효과를 얻을 수 있습니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-11 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © EdgeTools
//@version=5
strategy("123 Reversal Trading Strategy", overlay=true)
// Input for number of days to hold the trade
daysToHold = input(7, title="Days to Hold Trade")
// Input for 20-day moving average
maLength = input(200, title="Moving Average Length")
// Calculate the 20-day moving average
ma20 = ta.sma(close, maLength)
// Define the conditions for the 123 reversal pattern (bullish reversal)
// Condition 1: Today's low is lower than yesterday's low
condition1 = low < low[1]
// Condition 2: Yesterday's low is lower than the low three days ago
condition2 = low[1] < low[3]
// Condition 3: The low two days ago is lower than the low four days ago
condition3 = low[2] < low[4]
// Condition 4: The high two days ago is lower than the high three days ago
condition4 = high[2] < high[3]
// Entry condition: All conditions must be true
entryCondition = condition1 and condition2 and condition3 and condition4
// Exit condition: Close the position after a certain number of bars or when the price reaches the 20-day moving average
exitCondition = ta.barssince(entryCondition) >= daysToHold or close >= ma20
// Execute buy and sell signals
if (entryCondition)
strategy.entry("Buy", strategy.long)
if (exitCondition)
strategy.close("Buy")