PHP Code:// © Kinetik Komuta Merkezi [Masterpiece V6.9 - Z-PDH/PDL Likidite Radarύ]
//@version=6
indicator("KKM V6.9 Z-PDH/PDL (Likidite Radarύ)", overlay=true)
// ─────────────────────────────────────────────────────────────────
// 1. GέRDέLER VE KONFέGάRASYON (Sadeleώtirilmiώ)
// ─────────────────────────────────────────────────────────────────
int N = input.int(3, "Gφsterilecek Gόn Sayύsύ (Geηmiώ)", minval=1, maxval=10)
bool showCurrent = input.bool(true, "Mevcut Gόnό de Ηiz (Dinamik)")
color colH = input.color(color.new(#ff1744, 20), "Tepe (PDH) Likidite Rengi")
color colL = input.color(color.new(#00e676, 20), "Dip (PDL) Likidite Rengi")
int offset = input.int(0, "Gece Yarύsύ Dόzeltmesi (Saat)", minval=-12, maxval=12, tooltip="Aracύ kurum saat farkύ iηin")
// ─────────────────────────────────────────────────────────────────
// 2. TέPLER VE DέZέLER (Gφrsel Hafύza)
// ─────────────────────────────────────────────────────────────────
type DayData
int startTime
int endTime
float dHigh
float dLow
line hLine
line lLine
label hLabel
label lLabel
var array<DayData> days = array.new<DayData>()
var int curStart = na
var float curH = na
var float curL = na
var line curHLn = na
var line curLLn = na
// ─────────────────────────────────────────────────────────────────
// 3. ZAMAN VE GάN MANTIΠI
// ─────────────────────────────────────────────────────────────────
// Yeni gόnό, gece yarύsύ dόzeltmesiyle milisaniye cinsinden hesapla
int rawMidnight = timestamp(syminfo.timezone, year, month, dayofmonth, 0, 0)
int adjMidnight = rawMidnight + (offset * 3600000)
bool isNewDay = ta.change(adjMidnight) != 0
// ─────────────────────────────────────────────────────────────────
// 4. ΗέZέM YARDIMCILARI (Segmentasyon)
// ─────────────────────────────────────────────────────────────────
f_clean_oldest() =>
if array.size(days) > 0
DayData oldest = array.shift(days)
if not na(oldest.hLine)
line.delete(oldest.hLine)
if not na(oldest.lLine)
line.delete(oldest.lLine)
if not na(oldest.hLabel)
label.delete(oldest.hLabel)
if not na(oldest.lLabel)
label.delete(oldest.lLabel)
f_store_day(startT, endT, highP, lowP) =>
line hl = line.new(startT, highP, endT, highP, xloc=xloc.bar_time, color=colH, width=2, style=line.style_dashed)
line ll = line.new(startT, lowP, endT, lowP, xloc=xloc.bar_time, color=colL, width=2, style=line.style_dashed)
label hLab = label.new(startT + 60000, highP, "PDH", xloc=xloc.bar_time, color=color.new(color.white, 100), textcolor=colH, style=label.style_label_left, size=size.tiny)
label lLab = label.new(startT + 60000, lowP, "PDL", xloc=xloc.bar_time, color=color.new(color.white, 100), textcolor=colL, style=label.style_label_left, size=size.tiny)
array.push(days, DayData.new(startT, endT, highP, lowP, hl, ll, hLab, lLab))
while array.size(days) > N
f_clean_oldest()
// ─────────────────────────────────────────────────────────────────
// 5. ANA MOTOR (Gόnlόk Likidite Takibi)
// ─────────────────────────────────────────────────────────────────
if barstate.isfirst
curStart := adjMidnight
curH := high
curL := low
else
if isNewDay
// Bir φnceki gόnό hafύzaya al ve ηiz
if not na(curStart)
f_store_day(curStart, adjMidnight, curH, curL)
// Yeni gόnό baώlat
curStart := adjMidnight
curH := high
curL := low
// Dόnόn dinamik ηizgilerini sil
if not na(curHLn)
line.delete(curHLn)
if not na(curLLn)
line.delete(curLLn)
curHLn := na
curLLn := na
else
// Mevcut gόnό gόncelle
curH := math.max(curH, high)
curL := math.min(curL, low)
// Mevcut gόnόn dinamik ηizgisi (Opsiyonel)
if showCurrent and not na(curStart)
if na(curHLn)
curHLn := line.new(curStart, curH, time, curH, xloc=xloc.bar_time, color=color.new(colH, 50), width=1, style=line.style_dotted)
curLLn := line.new(curStart, curL, time, curL, xloc=xloc.bar_time, color=color.new(colL, 50), width=1, style=line.style_dotted)
else
line.set_xy1(curHLn, curStart, curH)
line.set_xy2(curHLn, time, curH)
line.set_xy1(curLLn, curStart, curL)
line.set_xy2(curLLn, time, curL)
else
if not na(curHLn)
line.delete(curHLn)
if not na(curLLn)
line.delete(curLLn)


Alύntύ yaparak yanύtla
Yer έmleri