
이것은 매우 간단한 트렌드를 따르는 전략이다. 그것은 다중형 공정 가격 차이가 있을 때 더 많이 하고, 공중형 공정 가격 차이가 있을 때 청산 또는 공백한다. 그것은 평형 상태에서 좋지 않은 성능을 발휘하지만, 트렌드 상태에서 매우 풍부한 이익을 얻을 수 있다.
이 전략의 핵심 논리는 공평 가격 격차 형태를 식별하는 것이다. 이른바 공평 가격 격차란, 하루의 최고 가격이 전날의 최저 가격보다 낮거나, 하루의 최저 가격이 전날의 최고 가격보다 높을 때, 돌파의 간격을 형성한다. 이것은 일반적으로 가능한 추세 전환을 예고한다. 구체적으로, 전략 규칙은 다음과 같다:
여기서 두 개의 lag, 즉 앞 두 K 선의 높고 낮은 가격을 사용하여 공정 가격 차이를 판단하여 가짜 돌파 또는 단기 회귀의 영향을 받지 않도록, 형태 판단의 신뢰성과 신호 품질을 향상시킵니다.
이 전략은 공정 가격 차이의 형성을 식별하여 추세가 역전될 수 있음을 판단하는 기본 추세 추적 전략에 속한다. 장점은 트렌드 역전의 타이밍이 정확하지만 약간의 오류가 존재한다는 것입니다. 위험을 차단하고 필터링을 통해 제어 할 수 있으며 판단의 정확성을 높이기 위해 더 많은 요소를 결합 할 수 있습니다.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
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/
// © Greg_007
//@version=5
strategy("Fair Value Gap Strategy", "FVG Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, pyramiding = 1)
var longOnly = input.bool(false, "Take only long trades?")
var pyramid = input.bool(false, "Since this can generate a lot of trades, make sure to fill in the commission (if applicable) for a realistic ROI.", group = "REMINDERS")
var pyramid2 = input.bool(false, "Modify pyramiding orders to increase the amount of trades.", group = "REMINDERS")
var bearFVG = false
var bullFVG = false
var plotBull = false
var plotBear = false
var bearTrend = false
var bullTrend = false
//BEARISH FVG
if high < low[2] and close[1] < low[2]
bullFVG := false
bearFVG := true
plotBear := true
if not longOnly
strategy.entry("Short", strategy.short)
else
strategy.close_all()
else
//BULLISH FVG
if low > high[2] and close[1] > high[2]
bullFVG := true
bearFVG := false
plotBull := true
strategy.entry("Long", strategy.long)
// plotshape(plotBull, style=shape.labeldown, location=location.abovebar, color=color.green, text="FVG",textcolor=color.white, size=size.tiny, title="Bull FVG", display=display.all - display.status_line)
// plotshape(plotBear, style=shape.labelup, location=location.belowbar, color=color.red, text="FVG",textcolor=color.white, size=size.tiny, title="Bear FVG", display=display.all - display.status_line)
// //reset the status
// plotBull := false
// plotBear := false