
이 전략은 동적 시간 프레임의 높은 낮은 점의 돌파구를 사용하여 거래 신호를 생성한다. 그것은 현재 시간 프레임의 최고 가격과 최저 가격을 이전 시간 프레임의 종결 가격과 더하기 감소한 특정 점으로 비교하여 구매를 결정한다. 이 방법은 다른 시장 움직임과 변동성에 적응할 수 있어 전략의 적응성과 유연성을 높인다.
이 전략의 핵심은 서로 다른 시간 프레임의 높고 낮은 점을 사용하여 가격 움직임을 판단하는 것이다. 첫째, 사용자가 선택한 시간 프레임에 따라 상응하는 최고 가격, 최저 가격 및 종결 가격 데이터를 얻는다. 다음으로, 현재 시간 프레임의 최고 가격이 이전 시간 프레임의 종결 가격보다 크는지 여부를 비교하여 특정 점수를 더하여 구매 신호를 결정한다. 마찬가지로, 현재 시간 프레임의 최저 가격이 이전 시간 프레임의 종결 가격보다 작는지 여부를 비교하여 특정 점수를 줄여 판매 신호를 결정한다.
동적 시간 프레임 고저점 돌파 전략은 다양한 시간 프레임의 가격 데이터를 활용하여 고저점 돌파에 따라 거래 신호를 생성한다. 이 전략은 논리적으로 명확하고, 적응력이 강하며, 구현 및 최적화하기 쉽다. 그러나 또한 파라미터 민감성, 과도한 적합성 및 시장 위험과 같은 문제가 있으며 실제 응용에서 지속적인 최적화 및 개선이 필요합니다.
/*backtest
start: 2023-05-28 00:00:00
end: 2024-06-02 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(" NIFTY 65-15 ", overlay=true)
// Define input options for point settings and timeframe
points = input.int(60, title="Point Threshold", minval=1, step=1)
timeframe = input.timeframe("60", title="Timeframe", options=["1", "3", "5", "15", "30", "60", "240", "D", "W", "M"])
// Calculate high and low of the selected timeframe
high_timeframe = request.security(syminfo.tickerid, timeframe, high)
low_timeframe = request.security(syminfo.tickerid, timeframe, low)
close_timeframe = request.security(syminfo.tickerid, timeframe, close)
// Define conditions for Buy and Sell
buyCondition = high_timeframe > (close_timeframe[1] + points)
sellCondition = low_timeframe < (close_timeframe[1] - points)
// Entry and exit rules
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.entry("Sell", strategy.short)
// Close the positions based on the conditions
if (sellCondition)
strategy.close("Buy")
if (buyCondition)
strategy.close("Sell")
// Plot Buy and Sell signals on the chart
plotshape(series=buyCondition, title="Buy Entry", color=color.green, style=shape.triangleup, location=location.belowbar)
plotshape(series=sellCondition, title="Sell Entry", color=color.red, style=shape.triangledown, location=location.abovebar)
// Plot the equity curve of the strategy
plot(strategy.equity, title="Equity", color=color.blue, linewidth=2)