PHP Code://@version=6
indicator("Crescent Markov-Fusion Elite", overlay = true)
// ==================== GÝRDÝLER ====================
tlm_lookback = input.int(20, "TLM Hassasiyeti")
mc_period = input.int(50, "Monte Carlo/Markov Periyodu")
radius_mult = input.int(25, "Hilal Menzili")
col_high = input.color(color.new(#ff0055, 20), "Direnç Kalkaný")
col_low = input.color(color.new(#00ffbb, 20), "Destek Kalkaný")
// ==================== MARKOV REJÝM ANALÝZÝ (BASÝTLEÞTÝRÝLMÝÞ) ====================
// Fiyatýn ardýþýk mumlardaki deðiþimine göre "Durum Geçiþ" olasýlýðý hesaplar
up_move = close > close[1] ? 1 : 0
down_move = close < close[1] ? 1 : 0
// Boða ve Ayý durumlarýnýn son periyottaki yoðunluðu (Geçiþ Olasýlýðý)
bull_prob = ta.sma(up_move, mc_period)
bear_prob = ta.sma(down_move, mc_period)
market_regime = bull_prob > 0.55 ? "Bull" : bear_prob > 0.55 ? "Bear" : "Neutral"
// ==================== TLM & MONTE CARLO MOTORU ====================
ph = ta.pivothigh(tlm_lookback, tlm_lookback)
pl = ta.pivotlow(tlm_lookback, tlm_lookback)
returns = math.log(close / close[1])
sigma = ta.stdev(returns, mc_period)
expected_vol = sigma * math.sqrt(radius_mult) * 1.96
// ==================== MARKOV ONAYLI HÝLAL ÇÝZÝMÝ ====================
ease_out(t) => t * (2 - t)
// Üst Hilal (Markov "Bear" veya "Neutral" iken daha güçlü)
var polyline hi_c = na
if not na(ph) and (market_regime == "Bear" or market_regime == "Neutral")
pts = array.new<chart.point>()
for i = 0 to 20
float t = i / 20.0
float angle = math.pi + (ease_out(t) * math.pi)
int x = int(math.round(math.cos(angle) * radius_mult)) + bar_index + radius_mult
float y = math.sin(angle) * (expected_vol * close) + high[tlm_lookback]
pts.push(chart.point.from_index(x, y))
polyline.delete(hi_c)
hi_c := polyline.new(pts, curved=true, line_color=col_high, line_width=4)
// Alt Hilal (Markov "Bull" veya "Neutral" iken daha güçlü)
var polyline lo_c = na
if not na(pl) and (market_regime == "Bull" or market_regime == "Neutral")
pts = array.new<chart.point>()
for i = 0 to 20
float t = i / 20.0
float angle = (ease_out(t) * math.pi)
int x = int(math.round(math.cos(angle) * radius_mult)) + bar_index + radius_mult
float y = math.sin(angle) * (expected_vol * close) + low[tlm_lookback]
pts.push(chart.point.from_index(x, y))
polyline.delete(lo_c)
lo_c := polyline.new(pts, curved=true, line_color=col_low, line_width=4)
// ==================== GÖRSELLEÞTÝRME & PANEL ====================
var table board = table.new(position.top_right, 2, 2, bgcolor=color.new(color.black, 80), border_width=1)
if barstate.islast
regime_col = market_regime == "Bull" ? color.lime : market_regime == "Bear" ? color.red : color.gray
table.cell(board, 0, 0, "Piyasa Rejimi:", text_color=color.white)
table.cell(board, 1, 0, market_regime, text_color=regime_col)
table.cell(board, 0, 1, "Boða Olasýlýðý:", text_color=color.white)
table.cell(board, 1, 1, "%" + str.tostring(bull_prob * 100, "##.#"), text_color=color.lime)




Alýntý yaparak yanýtla
Yer Ýmleri