PHP Code:// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © dg_factor
//@version=5
indicator("OHLC", overlay=true)
string tt = "The script does not contain any security calls.
If there are not enough bars on the chart, the result may not be displayed. You can try higher timeframes."
sh_monday = input.bool(false, "Monday ")
sh_daily = input.bool(false, "Daily ")
sh_weekly = input.bool(true, "Weekly ", tooltip=tt)
sh_monthly = input.bool(false, "Monthly ", tooltip=tt)
sh_ln = input.bool(true, "Line ", group="DISPLAY")
sh_tx = input.bool(true, "Text ", group="DISPLAY")
sh_pr = input.bool(true, "Price ", group="DISPLAY")
col_1 = input.color(#2962ff, "Color", inline="c", group="DISPLAY")
col_2 = input.color(#00bb00, "", inline="c", group="DISPLAY")
col_3 = input.color(#fb0000, "", inline="c", group="DISPLAY")
col_4 = input.color(#9C27B0, "", inline="c", group="DISPLAY")
p(x, y, c, t) =>
var line ln = na, line.delete(ln)
var label lb = na, label.delete(lb)
ln := sh_ln ? line.new(x, y, time, y, xloc.bar_time, color=c) : na
t1 = sh_tx ? t : na, t2 = sh_pr ? " [" + str.tostring(y, format.mintick) + "]" : na
lb := label.new(time, y, t1 + t2, xloc.bar_time, yloc.price,
#00000000, label.style_label_left, c, size.normal, text.align_right)
//
f(x, t) =>
s = x and not x[1]
f = not x and x[1]
o = ta.valuewhen(s, open, 0)
var h1 = 0.0, h1 := fixnan(not x ? na : s or f ? high : math.max(high, h1))
var l1 = 0.0, l1 := fixnan(not x ? na : s or f ? low : math.min(low, l1))
var h2 = 0.0, h2 := s ? high : math.max(high, h2)
var l2 = 0.0, l2 := s ? low : math.min(low, l2)
h = t == "Monday" ? h1 : h2
l = t == "Monday" ? l1 : l2
m = math.avg(h, l)
ot = ta.valuewhen(s, time, 0)
ht = ta.valuewhen(h==high, time, 0)
lt = ta.valuewhen(l==low, time, 0)
mt = math.max(ht, lt)
p(ot, o, col_1, sh_tx ? t + " Açılış" : na)
p(ht, h, col_2, sh_tx ? t + " Yüksek" : na)
p(lt, l, col_3, sh_tx ? t + " Düşük" : na)
p(mt, m, col_4, sh_tx ? t + " Ortalama" : na)
//
if sh_monday
f(dayofweek == dayofweek.monday, "HaftaBaşı")
if sh_daily
f(time_tradingday != time_tradingday[1], "Günlük")
if sh_weekly
f(dayofweek < dayofweek[1], "Haftalık")
if sh_monthly
f(dayofmonth < dayofmonth[1], "Aylık")
//
//@version=5
// Input parameters
length_high = input.int(20, title="High Length", minval=1)
length_low = input.int(20, title="Low Length", minval=1)
length_ema = input.int(20, title="EMA Length", minval=1)
// Calculate high and low within specified lengths
high_price = ta.highest(length_high)
low_price = ta.lowest(length_low)
median_price = (high_price + low_price) / 2
// Calculate EMAs for median price
ema_median = ta.ema(median_price, length_ema)
plot(median_price, color=color.rgb(19, 3, 253), style=plot.style_stepline, linewidth=1, title="Median")
plot(ema_median, color=color.rgb(247, 243, 3), style=plot.style_stepline, linewidth=1, title="EMAMedian")




Alıntı yaparak yanıtla



Yer İmleri