PHP Code:
//@version=6
indicator(title="Parabolic SAR Deviation [BigBeluga]", shorttitle="...", overlay=true, max_lines_count = 500, max_labels_count = 500)
//@version=6
init = input.float(0.009, title = 'Initial Start', step = 0.001)
fi = input.float(3, title = 'Increment/Start Ratio', step = 0.1)
fm = input.float(9, title = 'Max/Start Ratio', step = 0.1)
sar01 = ta.sar(init * 01, init * fi * 01, init * fm * 01)
sar10 = ta.sar(init * 10, init * fi * 10, init * fm * 10)
//plot(sar01, title = '01 SAR', style = plot.style_circles, color = renk ? sar01 > high ? color.red : color.green : color.silver, linewidth = 1)
//plot(sar10, title = '10 SAR', style = plot.style_circles, color = renk ? sar10 > high ? color.red : color.green : color.silver, linewidth = 1)
fd=(sar01+sar10)/2
plot(fd, title = 'SAR TREND', style = plot.style_stepline, color = renk ? fd > high ? color.red : color.green : color.silver, linewidth = 2)
////////////////////////////////
//@version=6
start = input(0.)
increment = input(0.1)
maximum = input(0.9, "Max Value")
out55 = ta.sar(start, increment, maximum)
plot_color = close > out55 ? color.rgb(5, 182, 64) : close < out55 ? color.rgb(169, 7, 7) : na
show_header = input(false, title="Show header?", group='Table Settings')
dashboard_position = input.string("Top center", title="Position", options=["Top right", "Top center", "Middle right"], group='Table Settings')
text_size = input.string('Normal', title="Size", options=["Tiny", "Small", "Normal", "Large"], group='Table Settings')
text_color = input.color(color.rgb(11, 68, 224), title="Text color", group='Table Settings')
table_color = input.color(color.purple, title="Border color", group='Table Settings')
uptrend_indicator = "🔵"
downtrend_indicator = "🟠"
tf1 = input.timeframe("1", title="Timeframe 1")
tf2 = input.timeframe("3", title="Timeframe 2")
tf3 = input.timeframe("5", title="Timeframe 3")
tf4 = input.timeframe("10", title="Timeframe 4")
tf5 = input.timeframe("15", title="Timeframe 5")
tf6 = input.timeframe("30", title="Timeframe 6")
tf7 = input.timeframe("60", title="Timeframe 7")
tf8 = input.timeframe("120", title="Timeframe 8")
tf9 = input.timeframe("240", title="Timeframe 9")
tf10 = input.timeframe("D", title="Timeframe 10")
var table_position = dashboard_position == 'Top center' ? position.top_center :
dashboard_position == 'Top center' ? position.top_center :
dashboard_position == 'Middle right' ? position.middle_right : position.middle_right
var table_text_size = text_size == 'Normal' ? size.normal :
text_size == 'Small' ? size.small : size.normal
var t = table.new(position=table_position, columns=3, rows=20, frame_color=#cdcbcb, frame_width=5, border_color=table_color, border_width=1,bgcolor =color.rgb(21, 21, 21) )
get_trend_status(trend_value) =>
is_uptrend = close > trend_value
candle_now = is_uptrend ? uptrend_indicator : downtrend_indicator
candle_now
//--------------------------------------------------------------------------------------
sar_1 = request.security(syminfo.tickerid, tf1, ta.sar(start, increment, maximum))
sar_2 = request.security(syminfo.tickerid, tf2, ta.sar(start, increment, maximum))
sar_3 = request.security(syminfo.tickerid, tf3, ta.sar(start, increment, maximum))
sar_4 = request.security(syminfo.tickerid, tf4, ta.sar(start, increment, maximum))
sar_5 = request.security(syminfo.tickerid, tf5, ta.sar(start, increment, maximum))
sar_6 = request.security(syminfo.tickerid, tf6, ta.sar(start, increment, maximum))
sar_7 = request.security(syminfo.tickerid, tf7, ta.sar(start, increment, maximum))
sar_8 = request.security(syminfo.tickerid, tf8, ta.sar(start, increment, maximum))
sar_9 = request.security(syminfo.tickerid, tf9, ta.sar(start, increment, maximum))
sar_10 = request.security(syminfo.tickerid, tf10, ta.sar(start, increment, maximum))
trend_indicator_1 = get_trend_status(sar_1)
trend_indicator_2 = get_trend_status(sar_2)
trend_indicator_3 = get_trend_status(sar_3)
trend_indicator_4 = get_trend_status(sar_4)
trend_indicator_5 = get_trend_status(sar_5)
trend_indicator_6 = get_trend_status(sar_6)
trend_indicator_7 = get_trend_status(sar_7)
trend_indicator_8 = get_trend_status(sar_8)
trend_indicator_9 = get_trend_status(sar_9)
trend_indicator_10 = get_trend_status(sar_10)
if tf1 == "60"
tf1 := "1H"
if tf1 == "120"
tf1 := "2H"
if tf1 == "180"
tf1 := "3H"
if tf1 == "240"
tf1 := "4H"
if tf2 == "60"
tf2 := "1H"
if tf2 == "120"
tf2 := "2H"
if tf2 == "180"
tf2 := "3H"
if tf2 == "240"
tf2 := "4H"
if tf3 == "60"
tf3 := "1H"
if tf3 == "120"
tf3 := "2H"
if tf3 == "180"
tf3 := "3H"
if tf3 == "240"
tf3 := "4H"
if tf4 == "60"
tf4 := "1H"
if tf4 == "120"
tf4 := "2H"
if tf4 == "180"
tf4 := "3H"
if tf4 == "240"
tf4 := "4H"
if tf5 == "60"
tf5 := "1H"
if tf5 == "120"
tf5 := "2H"
if tf5 == "180"
tf5 := "3H"
if tf5 == "240"
tf5 := "4H"
if tf6 == "60"
tf6 := "1H"
if tf6 == "120"
tf6 := "2H"
if tf6 == "180"
tf6 := "3H"
if tf6 == "240"
tf6 := "4H"
if tf7 == "60"
tf7 := "1H"
if tf7 == "120"
tf7 := "2H"
if tf7 == "180"
tf7 := "3H"
if tf7 == "240"
tf7 := "4H"
if tf8 == "60"
tf8 := "1H"
if tf8 == "120"
tf8 := "2H"
if tf8 == "180"
tf8 := "3H"
if tf8 == "240"
tf8 := "4H"
if tf9 == "60"
tf9 := "1H"
if tf9 == "120"
tf9 := "2H"
if tf9 == "180"
tf9 := "3H"
if tf9 == "240"
tf9 := "4H"
if tf10 == "60"
tf10 := "1H"
if tf10 == "120"
tf10 := "2H"
if tf10 == "180"
tf10 := "3H"
if tf10 == "240"
tf10 := "4H"
//---------------------------------------------------------------------------------------------
// Update table with trend data
//---------------------------------------------------------------------------------------------
if (barstate.islast)
table.cell(t, 0, 1, tf1, text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 1, 1, text="●", text_color=trend_indicator_1==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 1, str.tostring(sar_1, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 0, 2, tf2, text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 1, 2, text="●", text_color=trend_indicator_2==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 2, str.tostring(sar_2, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 0, 3, tf3, text_color=color.white, text_size=table_text_size,bgcolor= color.rgb(21, 21, 21))
table.cell(t, 1, 3, text="●", text_color=trend_indicator_3==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 3, str.tostring(sar_3, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 0, 4, tf4, text_color=color.white, text_size=table_text_size, bgcolor = color.rgb(21, 21, 21))
table.cell(t, 1, 4, text="●", text_color=trend_indicator_4==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 4, str.tostring(sar_4, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 0, 5, tf5, text_color=color.white, text_size=table_text_size, bgcolor = color.rgb(21, 21, 21))
table.cell(t, 1, 5, text="●", text_color=trend_indicator_5==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 5, str.tostring(sar_5, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 0, 6, tf6, text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 1, 6, text="●", text_color=trend_indicator_6==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 6, str.tostring(sar_6, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 0, 7, tf7, text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 1, 7, text="●", text_color=trend_indicator_7==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 7, str.tostring(sar_7, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 0, 8, tf8, text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 1, 8, text="●", text_color=trend_indicator_8==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 8, str.tostring(sar_8, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 0, 9, tf9, text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 1, 9, text="●", text_color=trend_indicator_9==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 9, str.tostring(sar_9, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 0, 10, tf10, text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t, 1, 10, text="●", text_color=trend_indicator_10==uptrend_indicator?color.lime:color.red,text_size = size.large)
table.cell(t, 2, 10, str.tostring(sar_10, "#.##"), text_color=color.white, text_size=table_text_size,bgcolor = color.rgb(21, 21, 21))
table.cell(t,0,0,"Periyot",text_color = color.white,bgcolor = color.rgb(21, 21, 21))
table.cell(t,1,0,"Trend",text_color = color.white,bgcolor = color.rgb(21, 21, 21))
table.cell(t,2,0,"Fiyat",text_color = color.white,bgcolor = color.rgb(21, 21, 21))
lookback = input.int(5, "Line Lookback Period", minval=1)
//////////////////////////DEVİNASYON İLE SMA HESAPLAMASIDIR///////////////////////
//@version=6
bool prices = input.bool(true, "Signals", group = "SAR")
color col_up = input.color(#40c3fb, "", inline = "col", group = "SAR")
color col_dn = input.color(#e040fb, "", inline = "col", group = "SAR")
float deviation_size = input.float(3.5, "Deviation", step = 0.1, group = "Deviation Levels")
color color_na = color.new(color.black, 100)
color standart_col = chart.fg_color
out88 = ta.sma(close,40)
deviation_levels(trend)=>
float dist = ta.sma(high-low, 100)*deviation_size
var lines = array.new<line>(1, line(na))
var labels = array.new<label>(1, label(na))
if trend != trend[1]
for i = 1 to 4
y = trend ? close+dist*i : close-dist*i
bool trend = close > out88
bool trend_up = ta.crossover(close, out88) and barstate.isconfirmed
bool trend_dn = ta.crossunder(close, out88) and barstate.isconfirmed
color trend_col = trend ? col_up : col_dn
if prices
if trend_up
label.new(bar_index, out88, "▲\n" + str.tostring(close, "#,###.####"), style=label.style_label_up, textcolor = trend_col, color = color_na)
if trend_dn
label.new(bar_index, out88, str.tostring(close, "#,###.####") + "\n▼", style=label.style_label_down, textcolor = trend_col, color = color_na)
//deviation_levels(trend)
///////////////DEVİNASYON VE 40 EMA İLE SAR TREND HESAAPLAMASIDIR//////////////////////
s13 = ta.sar(0, 0.1, 0.9)
lookBack13 = input(40)
multi13 = input.float(1, title = 'Multiplier', minval = 0.001, maxval = 2)
mean13 = ta.ema(s13, lookBack13)
stddev = multi13 * ta.stdev(s13, lookBack13)
b123 = mean13 + stddev
s232 = mean13 - stddev
meanp = plot(mean13, title = 'Sar Trend', color = color.new(color.yellow, 0))
//////////////////SAR İLE KANAL ARASI HESAPLAMASIDIR///////////////////////////
//@version=6
start1 = input(0.)
increment1 = input(0.1)
maximum1 = input(0.9)
xo = input(0.01)
xpr = input(0.01)
psar = 0.0 // PSAR
af = 0.0 // Acceleration Factor
trend_dir = 0 // Current direction of PSAR
ep = 0.0 // Extreme point
sar_long_to_short = trend_dir[1] == 1 and close <= psar[1] * (1 - xo) // PSAR switches from long to short and exceeds xo filter
sar_short_to_long = trend_dir[1] == -1 and close >= psar[1] * (1 + xo) // PSAR switches from short to long and exceeds xo filter
trend_change = barstate.isfirst[1] or sar_long_to_short or sar_short_to_long
// Calculate trend direction
trend_dir := barstate.isfirst[1] and close[1] > open[1] ? 1 : barstate.isfirst[1] and close[1] <= open[1] ? -1 : sar_long_to_short ? -1 : sar_short_to_long ? 1 : nz(trend_dir[1])
// Calculate Acceleration Factor
af := trend_change ? start1 : trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] ? math.min(maximum1, af[1] + increment1) : af[1]
// Calculate extreme point
ep := trend_change and trend_dir == 1 ? high : trend_change and trend_dir == -1 ? low : trend_dir == 1 ? math.max(ep[1], high * (1 + xpr)) : math.min(ep[1], low * (1 - xpr))
// Calculate PSAR
psar := barstate.isfirst[1] and close[1] > open[1] ? low[1] : barstate.isfirst[1] and close[1] <= open[1] ? high[1] : trend_change ? ep[1] : trend_dir == 1 ? psar[1] + af * (ep - psar[1]) : psar[1] - af * (psar[1] - ep)
plot(psar, style = plot.style_stepline, color = trend_dir == 1 ? color.yellow : color.blue,title = "KANAL",linewidth = 1)
////////////////////
start12 = input(0.)
increment12 = input(0.01)
maximum12 = input(0.9)
xo12 = input(0.01)
xpr12 = input(0.01)
psar12 = 0.0 // PSAR
af12 = 0.0 // Acceleration Factor
trend_dir12 = 0 // Current direction of PSAR
ep12 = 0.0 // Extreme point
sar_long_to_short12 = trend_dir12[1] == 1 and close <= psar12[1] * (1 - xo12) // PSAR switches from long to short and exceeds xo filter
sar_short_to_long12 = trend_dir12[1] == -1 and close >= psar12[1] * (1 + xo12) // PSAR switches from short to long and exceeds xo filter
trend_change12 = barstate.isfirst[1] or sar_long_to_short12 or sar_short_to_long12
// Calculate trend direction
trend_dir12 := barstate.isfirst[1] and close[1] > open[1] ? 1 : barstate.isfirst[1] and close[1] <= open[1] ? -1 : sar_long_to_short12 ? -1 : sar_short_to_long12 ? 1 : nz(trend_dir12[1])
// Calculate Acceleration Factor
af12 := trend_change12 ? start12 : trend_dir12 == 1 and high > ep12[1] or trend_dir12 == -1 and low < ep12[1] ? math.min(maximum12, af12[1] + increment12) : af12[1]
// Calculate extreme point
ep12 := trend_change12 and trend_dir12 == 1 ? high : trend_change12 and trend_dir12 == -1 ? low : trend_dir12 == 1 ? math.max(ep12[1], high * (1 + xpr12)) : math.min(ep12[1], low * (1 - xpr12))
// Calculate PSAR
psar12 := barstate.isfirst[1] and close[1] > open[1] ? low[1] : barstate.isfirst[1] and close[1] <= open[1] ? high[1] : trend_change12 ? ep12[1] : trend_dir12 == 1 ? psar12[1] + af12 * (ep12 - psar12[1]) : psar12[1] - af12 * (psar12[1] - ep12)
plot(psar12, style = plot.style_stepline, color = trend_dir12 == 1 ? color.yellow : color.blue,title = "KANAL",linewidth = 1)
///////////////////
Yer İmleri