
이 전략은 여러 기술 분석 도구를 결합한 고급 거래 시스템으로, 주로 높은 시간 프레임의 피보나치 리트랙트 레벨과 가격 고저점 돌파 조건에 기반하여 거래 신호를 생성한다. 전략은 더 높은 시간 프레임의 가격 데이터를 동적으로 계산하여 피보나치 리트랙트 레벨과 사용자 정의 된 가격 돌파 조건을 결합하여 완전한 거래 의사 결정 시스템을 형성한다. 이 방법은 시장의 전반적인 추세를 고려하면서도 단기 가격 돌파에 초점을 맞추고 있으며 시장의 전환점에서 잠재적인 거래 기회를 잡을 수 있다.
전략의 핵심 논리는 세 가지 주요 기둥 위에 세워져 있다. 첫째는 더 높은 시간 프레임의 가격 분석, 일선과 같은 더 높은 시간 주기의 개시 하위 하위 가격을 계산하여 더 거시적인 시장 관점을 구축한다. 둘째는 피보나치 회수 레벨의 동적 계산, 높은 시간 프레임의 가격 영역을 기반으로 중요한 지지부진의 지점을 설정한다. 마지막으로 가격 돌파구를 결정하며, 회수 기간의 최고 가격과 최저 가격을 돌파구 참조로 설정한다.
이것은 고전적인 기술 분석 도구의 여러 가지와 결합하여 이론적 기반과 실용적인 거래 전략을 만드는 잘 설계된 거래 시스템입니다. 이 전략의 가장 큰 특징은 다차원 분석을 통해 더 신뢰할 수있는 거래 신호를 제공 할 수 있다는 것입니다. 다양한 시장 환경에 적응할 수있는 충분한 유연성을 유지하면서도.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Fibonacci Levels Strategy with High/Low Criteria", overlay = true)
// Kullanıcıdan yüksek zaman dilimini ve mum bilgilerini al
timeframe = input.timeframe(defval = "D", title = "Higher Time Frame")
currentlast = input.string(defval = "Last", title = "Current or Last HTF Candle", options = ["Current", "Last"])
// Kullanıcıdan en düşük ve en yüksek fiyat bakış sürelerini al
lowestLookback = input(20, "Lowest Price Lookback", tooltip="The strategy will BUY when the price crosses over the lowest it has been in the last X amount of bars")
highestLookback = input(10, "Highest Price Lookback", tooltip="If Take-Profit is not checked, the strategy will SELL when the price crosses under the highest it has been in the last X amount of bars")
// Fibonacci seviyeleri ayarları
level0 = input.float(defval = 0.000, title = "Level 0")
level1 = input.float(defval = 0.236, title = "Level 1")
level2 = input.float(defval = 0.382, title = "Level 2")
level3 = input.float(defval = 0.500, title = "Level 3")
level4 = input.float(defval = 0.618, title = "Level 4")
level5 = input.float(defval = 0.786, title = "Level 5")
level100 = input.float(defval = 1.000, title = "Level 100")
// HTF mumlarını hesapla
newbar = ta.change(time(timeframe)) != 0
var float htfhigh = high
var float htflow = low
var float htfopen = open
float htfclose = close
var counter = 0
if newbar
htfhigh := high
htflow := low
htfopen := open
counter := 0
else
htfhigh := math.max(htfhigh, high)
htflow := math.min(htflow, low)
counter += 1
var float open_ = na
var float high_ = na
var float low_ = na
var float close_ = na
if currentlast == "Last" and newbar
open_ := htfopen[1]
high_ := htfhigh[1]
low_ := htflow[1]
close_ := htfclose[1]
else if currentlast == "Current"
open_ := htfopen
high_ := htfhigh
low_ := htflow
close_ := htfclose
// Fibonacci seviyelerini hesapla
var float[] fibLevels = array.new_float(6)
array.set(fibLevels, 0, open_ + (high_ - low_) * level0)
array.set(fibLevels, 1, open_ + (high_ - low_) * level1)
array.set(fibLevels, 2, open_ + (high_ - low_) * level2)
array.set(fibLevels, 3, open_ + (high_ - low_) * level3)
array.set(fibLevels, 4, open_ + (high_ - low_) * level4)
array.set(fibLevels, 5, open_ + (high_ - low_) * level5)
// Fibonacci seviyelerini grafik üzerine çiz
plot(array.get(fibLevels, 0), color=color.new(color.blue, 75), title="Fibonacci Level 0")
plot(array.get(fibLevels, 1), color=color.new(color.green, 75), title="Fibonacci Level 1")
plot(array.get(fibLevels, 2), color=color.new(color.red, 75), title="Fibonacci Level 2")
plot(array.get(fibLevels, 3), color=color.new(color.orange, 75), title="Fibonacci Level 3")
plot(array.get(fibLevels, 4), color=color.new(color.teal, 75), title="Fibonacci Level 4")
plot(array.get(fibLevels, 5), color=color.new(color.navy, 75), title="Fibonacci Level 5")
// En düşük ve en yüksek fiyat kriterlerini hesapla
lowcriteria = ta.lowest(low, lowestLookback)[1]
highcriteria = ta.highest(high, highestLookback)[1]
plot(highcriteria, color=color.green, title="Highest Price Criteria")
plot(lowcriteria, color=color.red, title="Lowest Price Criteria")
// Fibonacci seviyeleri ile ticaret sinyalleri oluştur
longCondition = close > lowcriteria and close > array.get(fibLevels, 3) // En düşük kriterin ve Fibonacci seviyesinin üstüne çıkarsa alım
shortCondition = close < highcriteria and close < array.get(fibLevels, 3) // En yüksek kriterin ve Fibonacci seviyesinin altına düşerse satış
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)