Bu strateji ile, Ichimoku göstergesinin verdiği al/sat sinyallerine uygun olarak long işlemlere giriş ve çıkış yapabiliriz.
Stratejide, alım işlemi koşulu için, Ichimoku göstergesi, isteğe bağlı olarak EMA 200 ile birlikte kullanılabilir.
Strateji dahilinde, stratejiye ait ön tanımlı değerler değiştirilebilir:
Aşağıdaki grafikte, stratejiyi yüklediğimizde ekrana gelecek olan tablonun değerleri ve açıklamaları gösterilmektedir:
Stratejinin temel değerleri ve anlamları aşağıda gösterilmektedir:
Bu ayarlar, stratejinin "Ayarlar/Özellikler" sekmesinde değiştirilebilir.
Aşağıdaki grafikte, stratejinin ön tanımlı değerleri gösterilmektedir:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Niteya (www.bilgigunlugum.net)
//@version=5
// Bu strateji şablonu sadece eğitim amaçlı olarak verilmiştir. Yatırım kararlarınızda kullanmayınız.
strategy("Niteya Strategy Ichimoku", shorttitle='Niteya Ich', overlay=true, calc_on_every_tick=true, commission_value=0.04, initial_capital=10000, default_qty_type=strategy.cash, default_qty_value=10000)
// Ichimoku inputs
ich_input = 'ICHIMOKU INPUTS'
TenkanSenPeriod = input.int(9, minval=1, title="Conversion Line Length", group=ich_input)
KijunSenPeriod = input.int(26, minval=1, title="Base Line Length", group=ich_input)
laggingSpan2Period = input.int(52, minval=1, title="Leading Span B Length", group=ich_input)
displacement = input.int(26, minval=1, title="Displacement", group=ich_input)
ich_temel = "ICHIMOKU KRİTERLER"
cloud_color = input.bool(false, 'Bulut rengi', inline='ich1', group=ich_temel)
cloud_color_s = input.bool(false, 'In short', inline='ich1', group=ich_temel)
cloud_color_future = input.bool(false, 'Bulut gelecek rengi', inline='ich2', group=ich_temel)
cloud_color_future_s = input.bool(false, 'In short', inline='ich2', group=ich_temel)
cloud_thick = input.bool(false, 'Bulut kalınlığı', inline='ich3', group=ich_temel)
cloud_thick_s = input.bool(false, 'In short', inline='ich3', group=ich_temel)
cloud_price = input.bool(true, 'Bulut ve fiyat *', inline='ich4', group=ich_temel)
cloud_price_s = input.bool(false, 'In short', inline='ich4', group=ich_temel)
cloud_tenkan = input.bool(true, 'Bulut ve TenkanSen *', inline='ich5', group=ich_temel)
cloud_tenkan_s = input.bool(false, 'In short', inline='ich5', group=ich_temel)
cloud_kijun = input.bool(true, 'Bulut ve KijunSen *', inline='ich6', group=ich_temel)
cloud_kijun_s = input.bool(false, 'In short', inline='ich6', group=ich_temel)
cloud_chikou = input.bool(false, 'Bulut ChikouSpan', inline='ich7', group=ich_temel)
cloud_chikou_s = input.bool(false, 'In short', inline='ich7', group=ich_temel)
price_tenkan = input.bool(true, 'Fiyat ve TenkanSen*', inline='ich8', group=ich_temel)
price_tenkan_s = input.bool(true, 'In short *', inline='ich8', group=ich_temel)
price_kijun = input.bool(true, 'Fiyat ve KijunSen *', inline='ich9', group=ich_temel)
price_kijun_s = input.bool(true, 'In short *', inline='ich9', group=ich_temel)
price_chikou = input.bool(false, 'Fiyat ve ChikouSpan', inline='ich10', group=ich_temel)
price_chikou_s = input.bool(false, 'In short', inline='ich10', group=ich_temel)
tenkan_kijun = input.bool(true, 'TenkanSen ve KijunSen *', inline='ich11', group=ich_temel)
tenkan_kijun_s = input.bool(true, 'In short *', inline='ich11', group=ich_temel)
chikou_kijun = input.bool(false, 'ChikouSpan ve KijunSen', inline='ich12', group=ich_temel)
chikou_kijun_s = input.bool(false, 'In short', inline='ich12', group=ich_temel)
chikou_tenkan = input.bool(false, 'ChikouSpan ve TenkanSen', inline='ich13', group=ich_temel)
chikou_tenkan_s = input.bool(false, 'In short', inline='ich13', group=ich_temel)
tenkan_slope = input.bool(false, 'Eğim TenkanSen', inline='ich14', group=ich_temel)
tenkan_slope_s = input.bool(false, 'In short', inline='ich14', group=ich_temel)
kijun_slope = input.bool(false, 'Eğim KijunSen', inline='ich15', group=ich_temel)
kijun_slope_s = input.bool(false, 'In short', inline='ich15', group=ich_temel)
senkA_slope = input.bool(false, 'Eğim SenkA', inline='ich16', group=ich_temel)
senkA_slope_s = input.bool(false, 'In short', inline='ich16', group=ich_temel)
senkB_slope = input.bool(false, 'Eğim SenkB', inline='ich17', group=ich_temel)
senkB_slope_s = input.bool(false, 'In short', inline='ich17', group=ich_temel)
ich_ema_long = input.bool(true, 'EMA 200', inline='ema')
ich_ema_short = input.bool(false, 'In short', inline='ema')
is_trend = input.bool(false, title="Trend gücü", inline='adx')
trend_short = input.bool(false, title="In short", inline='adx')
is_volume = input.bool(false, title="Hacim", inline='volume')
volume_short = input.bool(false, title="In short", inline='volume')
// EMA giriş değerleri
var string ema_group = 'EMA değerleri'
ema_length1 = input(20, 'EMA length1', group=ema_group)
ema_length2 = input(50, 'EMA length2', group=ema_group)
ema_length3 = input(200, 'EMA length3', group=ema_group)
is_ema_lines = input.bool(true, title='MA çizgileri', group=ema_group)
// Ichimoku calculations
get_avg(len, low_g, high_g) => math.avg(ta.lowest(low_g, len), ta.highest(high_g, len))
TenkanSen = get_avg(TenkanSenPeriod, low, high) // Mavi = Tenkan sen = Conversion Line = Dönüşüm çizgisi = 9 periyod geçmiş için en yüksek ve en düşük değerin ortalaması
KijunSen = get_avg(KijunSenPeriod, low, high) // Kırmızı = Kijun sen = Base Line = Ana çizgi = 26 periyod geçmiş için en yüksek ve en düşük değerin ortalaması
SenkA = math.avg(TenkanSen, KijunSen) // Açık yeşil = Senkou span A = Leading Span A = Mavi ve kırmızı ortalaması
SenkB = get_avg(laggingSpan2Period, low, high) // Açık kırmızı = Senkou span B = Leading Span B = 52 periyod geçmiş için en yüksek ve en düşük değerin ortalaması
ich_long_sub = cloud_color or cloud_color_future or cloud_thick or cloud_price or cloud_tenkan or cloud_kijun or cloud_chikou or price_tenkan or price_kijun or price_chikou or tenkan_kijun or
chikou_kijun or chikou_tenkan or tenkan_slope or kijun_slope or senkA_slope or senkB_slope or ich_ema_long
ich_short_sub = cloud_color_s or cloud_color_future_s or cloud_thick_s or cloud_price_s or cloud_tenkan_s or cloud_kijun_s or cloud_chikou_s or price_tenkan_s or price_kijun_s or price_chikou_s or
tenkan_kijun_s or chikou_kijun_s or chikou_tenkan_s or tenkan_slope_s or kijun_slope_s or senkA_slope_s or senkB_slope_s or ich_ema_short
ich_long = ((cloud_color and SenkA[displacement-1]>SenkB[displacement-1]) or (not cloud_color and ich_long_sub)) and // 1. Bulut yeşil ise
((cloud_color_future and SenkA>SenkB) or (not cloud_color_future and ich_long_sub)) and // 2. Gelecek bulut rengi yeşil ise
((cloud_thick and SenkA[displacement-1]-SenkB[displacement-1] >= 0.5) or (not cloud_thick and ich_long_sub)) and // 3. Bulut kalın yeşil ise
((cloud_price and close>SenkA[displacement-1] and close>SenkB[displacement-1]) or (not cloud_price and ich_long_sub)) and // 4. Fiyat grafiği bulut üzerinde ise
((cloud_tenkan and TenkanSen>SenkA[displacement-1] and TenkanSen>SenkB[displacement-1]) or (not cloud_tenkan and ich_long_sub)) and // 5. Mavi çizgi bulut üzerinde ise
((cloud_kijun and KijunSen>SenkA[displacement-1] and KijunSen>SenkB[displacement-1]) or (not cloud_kijun and ich_long_sub)) and // 6. Kırmızı çizgi bulut üzerinde ise
((cloud_chikou and close>SenkA[(displacement-1)+(displacement-1)] and close>SenkB[(displacement-1)+(displacement-1)]) or (not cloud_chikou and ich_long_sub)) and // 7. Yeşil çizgi bulut üzerinde ise
((price_tenkan and close>TenkanSen) or (not price_tenkan and ich_long_sub)) and // 8. Fiyat grafiği mavi çizginin üzerinde ise
((price_kijun and close>KijunSen) or (not price_kijun and ich_long_sub)) and // 9. Fiyat grafiği kırmızı çizgi üzerinde ise
((price_chikou and close>close[displacement-1]) or (not price_chikou and ich_long_sub)) and // 10. Yeşil çizgi fiyat grafiği üstünde ise
((tenkan_kijun and TenkanSen>KijunSen) or (not tenkan_kijun and ich_long_sub)) and // 11. Mavi çizgi kırmızı çizginin üzerinde ise
((chikou_kijun and close>KijunSen[displacement-1]) or (not chikou_kijun and ich_long_sub)) and // 12. Yeşil çizgi kırmızı çizgi üzerinde ise
((chikou_tenkan and close>TenkanSen[displacement-1]) or (not chikou_tenkan and ich_long_sub)) and // 13. Yeşil çizgi mavi çizgi üzerinde ise
((tenkan_slope and ta.mom(TenkanSen, 1) > 0) or (not tenkan_slope and ich_long_sub)) and
((kijun_slope and ta.mom(KijunSen, 1) > 0) or (not kijun_slope and ich_long_sub)) and // (ta.mom(KijunSen, 1)*100/KijunSen)
((senkA_slope and ta.mom(SenkA, 1) > 0) or (not senkA_slope and ich_long_sub)) and
((senkB_slope and ta.mom(SenkB, 1) > 0) or (not senkB_slope and ich_long_sub)) and
((ich_ema_long and close>ta.ema(close, 200)) or (not ich_ema_long and ich_long_sub))
ich_short = ((cloud_color_s and SenkA[displacement-1]<SenkB[displacement-1]) or (not cloud_color_s and ich_short_sub)) and // 1. Bulut kırmızı ise
((cloud_color_future_s and SenkA<SenkB) or (not cloud_color_future_s and ich_short_sub)) and // 2. Gelecek bulut rengi kırmızı ise
((cloud_thick_s and SenkB[displacement-1]-SenkA[displacement-1] >= 0.5) or (not cloud_thick_s and ich_short_sub)) and // 3. Bulut kalın kırmızı ise
((cloud_price_s and close<SenkA[displacement-1] and close<SenkB[displacement-1]) or (not cloud_price_s and ich_short_sub)) and // 4. Fiyat grafiği bulut altında ise
((cloud_tenkan_s and TenkanSen<SenkA[displacement-1] and TenkanSen<SenkB[displacement-1]) or (not cloud_tenkan_s and ich_short_sub)) and // 5. Mavi çizgi bulut altında ise
((cloud_kijun_s and KijunSen>SenkA[displacement-1] and KijunSen>SenkB[displacement-1]) or (not cloud_kijun_s and ich_short_sub)) and // 6. Kırmızı çizgi bulut altında ise
((cloud_chikou_s and close<SenkA[(displacement-1)+(displacement-1)] and close<SenkB[(displacement-1)+(displacement-1)]) or (not cloud_chikou_s and ich_short_sub)) and // 7. Yeşil çizgi bulut altında ise
((price_tenkan_s and close<TenkanSen) or (not price_tenkan_s and ich_short_sub)) and // 8. Fiyat grafiği mavi çizginin altında ise
((price_kijun_s and close<KijunSen) or (not price_kijun_s and ich_short_sub)) and // 9. Fiyat grafiği kırmızı çizgi altında ise
((price_chikou_s and close<close[displacement-1]) or (not price_chikou_s and ich_short_sub)) and // 10. Yeşil çizgi fiyat grafiği altında ise
((tenkan_kijun_s and TenkanSen<KijunSen) or (not tenkan_kijun_s and ich_short_sub)) and // 11. Mavi çizgi kırmızı çizginin altında ise
((chikou_kijun_s and close<KijunSen[displacement-1]) or (not chikou_kijun_s and ich_short_sub)) and // 12. Yeşil çizgi kırmızı çizgi altında ise
((chikou_tenkan_s and close<TenkanSen[displacement-1]) or (not chikou_tenkan_s and ich_short_sub)) and // 13. Yeşil çizgi mavi çizgi altında ise
((tenkan_slope_s and ta.mom(TenkanSen, 1) < 0) or (not tenkan_slope_s and ich_short_sub)) and
((kijun_slope_s and ta.mom(KijunSen, 1) < 0) or (not kijun_slope_s and ich_short_sub)) and // (ta.mom(KijunSen, 1)*100/KijunSen)
((senkA_slope_s and ta.mom(SenkA[displacement-1], 1) < 0) or (not senkA_slope_s and ich_short_sub)) and
((senkB_slope_s and ta.mom(SenkB[displacement-1], 1) < 0) or (not senkB_slope_s and ich_short_sub)) and
((ich_ema_short and close<ta.ema(close, 200)) or (not ich_ema_short and ich_short_sub))
ichimoku_value = ich_long ? 1 : ich_short ? -1 : 0
// EMA
ema_11 = ta.ema(close, ema_length1)
ema_12 = ta.ema(close, ema_length2)
ema_13 = ta.ema(close, ema_length3)
plot(is_ema_lines ? ema_11 : na, title="MA src1", color=color.blue, linewidth=1)
plot(is_ema_lines ? ema_12 : na, title="MA src2", color=color.orange, linewidth=2)
plot(is_ema_lines ? ema_13 : na, title="MA src3", color=color.black, linewidth=3)
var long_vals = "Long işlem çıkış değerleri"
sl_method = input.string('Short', title="Çıkış yöntemi", options=['Stop loss', 'Short', 'Both'], group=long_vals)
// Zarar durdur için ATR giriş değerleri
atr_period = input.int(14, 'Zarar durdur ATR periyodu', minval=7, step=1, group=long_vals)
atr_multiplier = input.float(3, 'Zarar durdur ATR çarpanı', minval=1.5, step=0.1, group=long_vals)
// Backtest periyodu
var backtest = "Backtest periyodu"
StartDay = input(1, 'Başlangıç günü', group=backtest)
StartMonth = input(1, 'Başlangıç ayı', group=backtest)
StartYear = input(2021, 'Başlangıç yılı', group=backtest)
PeriodStart = timestamp(StartYear, StartMonth, StartDay, 0, 0)
StopDay = input(31, 'Bitiş günü', group=backtest)
StopMonth = input(12, 'Bitiş ayı', group=backtest)
StopYear = input(9999, 'Bitiş yılı', group=backtest)
PeriodStop = timestamp(StopYear, StopMonth, StopDay, 0, 0)
// DMI değerleri
dmi_lensig = input.int(14, title="ADX Smoothing", minval=1, maxval=50)
dmi_len = input.int(14, minval=1, title="ADX DI Length")
dmi_level = input.int(25, minval=20, title="ADX level")
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
trur = ta.rma(ta.tr, dmi_len)
plus = fixnan(100 * ta.rma(plusDM, dmi_len) / trur)
minus = fixnan(100 * ta.rma(minusDM, dmi_len) / trur)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), dmi_lensig)
trend_value = adx>adx[1] and adx>=dmi_level and adx>=ta.sma(adx, 10) ? 1 : 0
// Hacim hesaplama
volume_value = (volume >= 1.1 * ta.sma(volume, 10)) ? 1 : 0
var int long_index = 0
var float long_price = 0.00
var int stop_index = 0
var float stop_val = 0.00
var int long_no = 0
var int close_no = 0
// ATR hesaplama
atr_long = ta.atr(atr_period)
// İz süren stop hesaplama
stop_loss_atr = atr_multiplier * atr_long
Trail = 0.0
iff_1 = close > nz(Trail[1], 0) ? close - stop_loss_atr : close + stop_loss_atr
iff_2 = close < nz(Trail[1], 0) and close[1] < nz(Trail[1], 0) ? math.min(nz(Trail[1], 0), close + stop_loss_atr) : iff_1
Trail := close > nz(Trail[1], 0) and close[1] > nz(Trail[1], 0) ? math.max(nz(Trail[1], 0), close - stop_loss_atr) : iff_2
ema_200 = ta.ema(close, 200)
entry_long = ichimoku_value==1 and (not na(ema_200) ? close>ema_200 : true) and (is_volume ? volume_value==1 : true) and (is_trend ? trend_value==1 : true)
entry_short = ichimoku_value==-1 and (volume_short ? volume_value==1 : true) and (trend_short ? trend_value==1 : true)
entry_price_long = ta.valuewhen(entry_long, close, 0)
stop_loss_long = Trail
exit_long = close<stop_loss_long
// Aktif periyot
var int PeriodS1 = 0
var int PeriodS2 = 0
if barstate.isfirst
if time >= PeriodStart
PeriodS1 := timestamp(year(time), month(time), dayofmonth(time), 0, 0)
else
PeriodS1 := timestamp(year(PeriodStart), month(PeriodStart), dayofmonth(PeriodStart), 0, 0)
if last_bar_time <= PeriodStop
PeriodS2 := timestamp(year(last_bar_time), month(last_bar_time), dayofmonth(last_bar_time), 0, 0)
else
PeriodS2 := timestamp(year(PeriodStop), month(PeriodStop), dayofmonth(PeriodStop), 0, 0)
// Hissenin periyot içindeki ilk ve son fiyatı
var float close_s = na
var float close_e = na
if time >= PeriodS1 and na(close_s[1])
close_s := close
else
close_s := close_s[1]
if time >= PeriodS2 and na(close_e[1])
close_e := close
else
close_e := close_e[1]
var int bar_number_period = 0
var int bar_number_long = 0
In_Period() =>
time >= PeriodStart and time <= PeriodStop ? true : false
bar_index_o = (last_bar_index - bar_index)
if In_Period()
if entry_long and strategy.opentrades==0
strategy.entry('long', strategy.long, comment='BUY' + '(' + str.tostring(bar_index_o+1) + ')')
long_price := entry_price_long
long_index := bar_index_o
long_no += 1
if strategy.opentrades>0 and (sl_method=='Both' ? exit_long or entry_short : (sl_method=='Stop loss' ? exit_long : entry_short))
strategy.close('long', comment='SELL' + '(' + str.tostring(bar_index_o+1) + ')')
close_no += 1
stop_index := bar_index_o
stop_val := close
long_price := 0.00
long_index := 0
bar_number_period += 1
if long_price!=0.00
bar_number_long += 1
plot_con = In_Period() and strategy.position_size > 0
plot(plot_con and not exit_long ? stop_loss_long : na, style=plot.style_linebr, color=color.new(color.red, 0), linewidth=1, title='Stop loss level')
// plot(stop_loss_long, style=plot.style_linebr, color=color.new(color.red, 0), linewidth=1, title='Stop loss level')
GetWinRate(includeEvens = false) =>
winTradeCount = strategy.wintrades + (includeEvens ? strategy.eventrades : 0)
(winTradeCount / strategy.closedtrades) * 100
get_date(time_val) =>
str.tostring(dayofmonth(time_val), "00") + '.' + str.tostring(month(time_val), "00") + '.' + str.tostring(year(time_val)) + ' (' + str.tostring(hour(time_val), "00") + ':' + str.tostring(minute(time_val), "00") + ':' + str.tostring(second(time_val), "00") + ')'
bar_number = last_bar_index+1
var label label_ema1 = na
var label label_ema2 = na
var label label_ema3 = na
if barstate.islast
string time_str = ''
period = timeframe.period
gwr = GetWinRate()
text_color_wr = gwr > 0 ? color.green : gwr < 0 ? color.red : color.gray
text_color_np = strategy.netprofit > 0 ? color.green : strategy.netprofit < 0 ? color.red : color.gray
text_color_single = close_e-close_s > 0 ? color.green : close_e-close_s < 0 ? color.red : color.gray
switch
period=="1" => time_str := '1 dakika'
period=="3" => time_str := '3 dakika'
period=="5" => time_str := '5 dakika'
period=="15" => time_str := '15 dakika'
period=="30" => time_str := '30 dakika'
period=="45" => time_str := '45 dakika'
period=="60" => time_str := '1 saat'
period=="120" => time_str := '2 saat'
period=="180" => time_str := '3 saat'
period=="240" => time_str := '4 saat'
str.pos(period, "D")>=0 => time_str := '1 gün'
str.pos(period, "W")>=0 => time_str := '1 hafta'
str.pos(period, "M")>=0 => time_str := '1 ay'
var table m_table = table.new(position.bottom_right, columns=2, rows=13, bgcolor=color.rgb(212, 212, 212), border_width=1, border_color=color.white)
table.merge_cells(m_table, 0, 0, 1, 0)
last_time = StopYear==9999 ? time : PeriodStop
period_start = str.tostring(dayofmonth(PeriodStart), "00") + '.' + str.tostring(month(PeriodStart), "00") + '.' + str.tostring(year(PeriodStart))
period_end = str.tostring(dayofmonth(last_time), "00") + '.' + str.tostring(month(last_time), "00") + '.' + str.tostring(year(last_time))
table.cell(m_table, 0, 0, "Niteya Ich (" + period_start + "-" + period_end + ")" + ' - ' + str.tostring(time_str), text_color=color.white, text_halign=text.align_center, text_size=size.normal, bgcolor=color.new(#31153a, 0))
table.cell(m_table, 0, 1, 'Karlı yüzde (%)', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.orange)
table.cell(m_table, 0, 2, 'Net kar (%)', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.orange)
table.cell(m_table, 0, 3, 'Açılan işlemler', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.orange)
table.cell(m_table, 0, 4, 'Kapanan işlemler', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.orange)
table.cell(m_table, 0, 5, 'Başlangıç tarihi', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.orange)
table.cell(m_table, 0, 6, 'Bitiş tarihi', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.orange)
table.cell(m_table, 0, 7, 'Long/Toplam bar sayısı', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.orange)
table.cell(m_table, 0, 8, 'İlk fiyat (' + period_start + ')', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.rgb(103, 74, 31))
table.cell(m_table, 0, 9, 'Son fiyat (' + period_end + ')', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.rgb(103, 74, 31))
table.cell(m_table, 0, 10, 'Net kar (%)', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.rgb(103, 74, 31))
table.cell(m_table, 0, 11, 'Net kar', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.rgb(103, 74, 31))
table.cell(m_table, 0, 12, 'Fiyat', text_color=color.rgb(244, 244, 244), text_halign=text.align_left, text_size=size.normal, bgcolor=color.rgb(148, 107, 44))
if not na(gwr)
table.cell(m_table, 1, 1, str.tostring(gwr, '0.00'), text_color=text_color_wr, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
table.cell(m_table, 1, 2, str.tostring((100*strategy.netprofit)/strategy.initial_capital, '0.00'), text_color=text_color_np, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
table.cell(m_table, 1, 3, str.tostring(long_no), text_color=#505050, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
table.cell(m_table, 1, 4, str.tostring(strategy.closedtrades), text_color=#505050, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
table.cell(m_table, 1, 5, str.tostring(dayofmonth(PeriodS1), "00") + '.' + str.tostring(month(PeriodS1), "00") + '.' + str.tostring(year(PeriodS1)), text_color=#505050, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
table.cell(m_table, 1, 6, str.tostring(dayofmonth(PeriodS2), "00") + '.' + str.tostring(month(PeriodS2), "00") + '.' + str.tostring(year(PeriodS2)), text_color=#505050, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
table.cell(m_table, 1, 7, str.tostring(bar_number_long) + '/' + str.tostring(bar_number_period), text_color=#505050, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
np = (close_e-close_s)*(strategy.initial_capital/close_s)
table.cell(m_table, 1, 8, str.tostring(close_s, '0.00'), text_color=#505050, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
table.cell(m_table, 1, 9, str.tostring(close_e, '0.00'), text_color=#505050, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212), tooltip=str.tostring(close_e, '0.00') + ' - ' + str.tostring(volume, '0')) // volume*close
table.cell(m_table, 1, 10, str.tostring((100*np)/strategy.initial_capital, '0.00'), text_color=text_color_single, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
table.cell(m_table, 1, 11, str.tostring(np, '0.00'), text_color=text_color_single, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
table.cell(m_table, 1, 12, str.tostring(close, '0.00'), text_color=text_color_single, text_halign=text.align_right, text_size=size.normal, bgcolor=color.rgb(212, 212, 212))
if is_ema_lines
label.delete(label_ema1)
label.delete(label_ema2)
label.delete(label_ema3)
label_ema1 := label.new(x=bar_index+2, y=ema_11, text=str.tostring(ema_length1), color=color.blue, style=label.style_label_center, textcolor=color.white, size=size.small)
label_ema2 := label.new(x=bar_index+2, y=ema_12, text=str.tostring(ema_length2), color=color.orange, style=label.style_label_center, textcolor=color.white, size=size.small)
label_ema3 := label.new(x=bar_index+2, y=ema_13, text=str.tostring(ema_length3), color=color.black, style=label.style_label_center, textcolor=color.white, size=size.small)
Yukarıdaki strateji ile ilgili bir uygulama aşağıdaki grafikte gösterilmektedir.