Arz/Talep Tarama

mail@pastecode.io avatar
unknown
plain_text
a month ago
42 kB
10
Indexable
Never
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Ahmet_Erkol

//@version=5
indicator(title='TARAMA', shorttitle='TARAMA', overlay=true)
gurupSec = input.string(defval='1', options=['1', '2', '3', '4', '5','6','7'], group='Taraması yapılacak 40\'arlı gruplardan birini seçin', title='Grup seç')
per = input.timeframe(defval='240', title='PERİYOT',group = "Tarama yapmak istediğiniz periyotu seçin")
loc = input.int(defval=10, title='Konum Ayarı', minval = -100,maxval = 100 , step = 5,  group='Tablonun konumunu belirleyin')

//SETTINGS
//

//      INDICATOR SETTINGS
swing_length = input.int(12, title = 'Swing High/Low Uzunluğu', group = 'Settings', minval = 1, maxval = 50)
history_of_demand_to_keep = input.int(20, title = 'History To Keep', minval = 5, maxval = 50)
box_width = input.float(10, title = 'Arz/Talep Kutu Genişliği', group = 'Settings', minval = 1, maxval = 20, step = 0.5)

//      INDICATOR VISUAL SETTINGS
show_zigzag = input.bool(false, title = 'Zig Zag Göster', group = 'Visual Settings', inline = '1')
show_price_action_labels = input.bool(false, title = 'Price Action Yazılarını Göster', group = 'Visual Settings', inline = '2')

supply_color = input.color(color.new(#EDEDED,70), title = 'Arz', group = 'Visual Settings', inline = '3')
supply_outline_color = input.color(color.new(color.white,85), title = 'Outline', group = 'Visual Settings', inline = '3')

demand_color = input.color(color.new(#00FFFF,70), title = 'Talep', group = 'Visual Settings', inline = '4')
demand_outline_color = input.color(color.new(color.white,85), title = 'Outline', group = 'Visual Settings', inline = '4')

poi_label_color = input.color(color.white, title = 'POI Yazısı', group = 'Visual Settings', inline = '7')

swing_type_color = input.color(color.black, title = 'Price Action Yazıları', group = 'Visual Settings', inline = '8')
zigzag_color = input.color(color.new(#000000,0), title = 'Zig Zag', group = 'Visual Settings', inline = '9')

//
//END SETTINGS
//


//
//FUNCTIONS
//

//      FUNCTION TO ADD NEW AND REMOVE LAST IN ARRAY
f_array_add_pop(array, new_value_to_add) =>
    array.unshift(array, new_value_to_add)
    array.pop(array)

//      FUNCTION SWING H & L LABELS
f_sh_sl_labels(array, swing_type) =>

    var string label_text = na
    if swing_type == 1
        if array.get(array, 0) >= array.get(array, 1)
            label_text := 'HH'
        else
            label_text := 'LH'
        label.new(bar_index - swing_length, array.get(array,0), text = label_text, style=label.style_label_down, textcolor = swing_type_color, color = color.new(swing_type_color, 100), size = size.tiny)
    
    else if swing_type == -1
        if array.get(array, 0) >= array.get(array, 1)
            label_text := 'HL'
        else
            label_text := 'LL'
        label.new(bar_index - swing_length, array.get(array,0), text = label_text, style=label.style_label_up, textcolor = swing_type_color, color = color.new(swing_type_color, 100), size = size.tiny)

//      FUNCTION MAKE SURE SUPPLY ISNT OVERLAPPING
f_check_overlapping(new_poi, box_array, atr) =>

    atr_threshold = atr * 2
    okay_to_draw = true

    for i = 0 to array.size(box_array) - 1
        top = box.get_top(array.get(box_array, i))
        bottom = box.get_bottom(array.get(box_array, i))
        poi = (top + bottom) / 2

        upper_boundary = poi + atr_threshold
        lower_boundary = poi - atr_threshold

        if new_poi >= lower_boundary and new_poi <= upper_boundary
            okay_to_draw := false
            break
        else 
            okay_to_draw := true
    okay_to_draw


//      FUNCTION TO DRAW SUPPLY OR DEMAND ZONE
f_supply_demand(value_array, bn_array, box_array, label_array, box_type, atr) =>

    atr_buffer = atr * (box_width / 10)
    box_left = array.get(bn_array, 0)
    box_right = bar_index

    var float box_top = 0.00
    var float box_bottom = 0.00
    var float poi = 0.00


    if box_type == 1
        box_top := array.get(value_array, 0)
        box_bottom := box_top - atr_buffer
        poi := (box_top + box_bottom) / 2
    else if box_type == -1
        box_bottom := array.get(value_array, 0)
        box_top := box_bottom + atr_buffer
        poi := (box_top + box_bottom) / 2

    okay_to_draw = f_check_overlapping(poi, box_array, atr)
    // okay_to_draw = true

    //delete oldest box, and then create a new box and add it to the array
    if box_type == 1 and okay_to_draw
        box.delete( array.get(box_array, array.size(box_array) - 1) )
        f_array_add_pop(box_array, box.new( left = box_left, top = box_top, right = box_right, bottom = box_bottom, border_color = supply_outline_color,
             bgcolor = supply_color, extend = extend.right, text = 'Arz Bölgesi', text_halign = text.align_center, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
        
        box.delete( array.get(label_array, array.size(label_array) - 1) )
        f_array_add_pop(label_array, box.new( left = box_left, top = poi, right = box_right, bottom = poi, border_color = color.new(poi_label_color,90),
             bgcolor = color.new(poi_label_color,90), extend = extend.right, text = '', text_halign = text.align_left, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))

    else if box_type == -1 and okay_to_draw
        box.delete( array.get(box_array, array.size(box_array) - 1) )
        f_array_add_pop(box_array, box.new( left = box_left, top = box_top, right = box_right, bottom = box_bottom, border_color = demand_outline_color,
             bgcolor = demand_color, extend = extend.right,  text = 'Talep Bölgesi', text_halign = text.align_center, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
        
        box.delete( array.get(label_array, array.size(label_array) - 1) )
        f_array_add_pop(label_array, box.new( left = box_left, top = poi, right = box_right, bottom = poi, border_color = color.new(poi_label_color,90),
             bgcolor = color.new(poi_label_color,90), extend = extend.right,  text = '', text_halign = text.align_left, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))

// FUNCTION TO CHANGE SUPPLY/DEMAND TO A BOS IF BROKEN

var float condition_arz = 0.0
var float condition_talep = 0.0

f_sd_to_bos(box_array, bos_array, label_array, zone_type) =>
    if zone_type == 1
        for i = 0 to array.size(box_array) - 1
            level_to_break = box.get_top(array.get(box_array,i))
            // if ta.crossover(close, level_to_break)
            if close >= level_to_break
                copied_box = box.copy(array.get(box_array,i))
                f_array_add_pop(bos_array, copied_box)
                mid = (box.get_top(array.get(box_array,i)) + box.get_bottom(array.get(box_array,i))) / 2
                box.set_top(array.get(bos_array,0), mid)
                box.set_bottom(array.get(bos_array,0), mid)
                box.set_extend( array.get(bos_array,0), extend.none)
                box.set_right( array.get(bos_array,0), bar_index)
                box.set_text( array.get(bos_array,0), 'Kırılım' )
                box.set_text_color( array.get(bos_array,0), color.green)
                box.set_text_size( array.get(bos_array,0), size.small)
                box.set_text_halign( array.get(bos_array,0), text.align_center)
                box.set_text_valign( array.get(bos_array,0), text.align_center)
                box.delete(array.get(box_array, i))
                box.delete(array.get(label_array, i))
                math.abs(condition_arz) == true
                alert("Fiyat ARZ Bölgesinde",alert.freq_once_per_bar )
    if zone_type == -1
        for i = 0 to array.size(box_array) - 1
            level_to_break = box.get_bottom(array.get(box_array,i))
            // if ta.crossunder(close, level_to_break)
            if close <= level_to_break
                copied_box = box.copy(array.get(box_array,i))
                f_array_add_pop(bos_array, copied_box)
                mid = (box.get_top(array.get(box_array,i)) + box.get_bottom(array.get(box_array,i))) / 2
                box.set_top(array.get(bos_array,0), mid)
                box.set_bottom(array.get(bos_array,0), mid)
                box.set_extend( array.get(bos_array,0), extend.none)
                box.set_right( array.get(bos_array,0), bar_index)
                box.set_text( array.get(bos_array,0), 'Kırılım' )
                box.set_text_color( array.get(bos_array,0), color.red)
                box.set_text_size( array.get(bos_array,0), size.small)
                box.set_text_halign( array.get(bos_array,0), text.align_center)
                box.set_text_valign( array.get(bos_array,0), text.align_center)
                box.delete(array.get(box_array, i))
                box.delete(array.get(label_array, i))
                math.abs(condition_talep) == true
                alert("Fiyat TALEP Bölgesinde",alert.freq_once_per_bar )

    
//      FUNCTION MANAGE CURRENT BOXES BY CHANGING ENDPOINT
f_extend_box_endpoint(box_array) =>

    for i = 0 to array.size(box_array) - 1
        box.set_right(array.get(box_array, i), bar_index + 100)


//
//END FUNCTIONS
//  


//
//CALCULATIONS
//

//      CALCULATE ATR 
atr = ta.atr(50)

//      CALCULATE SWING HIGHS & SWING LOWS
swing_high = ta.pivothigh(high, swing_length, swing_length)
swing_low = ta.pivotlow(low, swing_length, swing_length)

//      ARRAYS FOR SWING H/L & BN 
var swing_high_values = array.new_float(5,0.00)
var swing_low_values = array.new_float(5,0.00)

var swing_high_bns = array.new_int(5,0)
var swing_low_bns = array.new_int(5,0)

//      ARRAYS FOR SUPPLY / DEMAND
var current_supply_box = array.new_box(history_of_demand_to_keep, na)
var current_demand_box = array.new_box(history_of_demand_to_keep, na)

//      ARRAYS FOR SUPPLY / DEMAND POI LABELS
var current_supply_poi = array.new_box(history_of_demand_to_keep, na)
var current_demand_poi = array.new_box(history_of_demand_to_keep, na)

//      ARRAYS FOR BOS
var supply_bos = array.new_box(5, na)
var demand_bos = array.new_box(5, na)
//
//END CALCULATIONS
//

//      NEW SWING HIGH
if not na(swing_high)

    //MANAGE SWING HIGH VALUES
    f_array_add_pop(swing_high_values, swing_high)
    f_array_add_pop(swing_high_bns, bar_index[swing_length])
    if show_price_action_labels
        f_sh_sl_labels(swing_high_values, 1)

    f_supply_demand(swing_high_values, swing_high_bns, current_supply_box, current_supply_poi, 1, atr)

//      NEW SWING LOW
else if not na(swing_low)

    //MANAGE SWING LOW VALUES
    f_array_add_pop(swing_low_values, swing_low)
    f_array_add_pop(swing_low_bns, bar_index[swing_length])
    if show_price_action_labels
        f_sh_sl_labels(swing_low_values, -1)
    
    f_supply_demand(swing_low_values, swing_low_bns, current_demand_box, current_demand_poi, -1, atr)


f_sd_to_bos(current_supply_box, supply_bos, current_supply_poi, 1)
f_sd_to_bos(current_demand_box, demand_bos, current_demand_poi, -1)

f_extend_box_endpoint(current_supply_box)
f_extend_box_endpoint(current_demand_box)

//ZIG ZAG
h100 = ta.highest(high, swing_length * 2 + 1)
l100 = ta.lowest(low, swing_length * 2 + 1)
f_isMin(len) =>
    l100 == low[len]
f_isMax(len) =>
    h100 == high[len]

var dirUp = false
var lastLow = high * 100
var lastHigh = 0.0
var timeLow = bar_index
var timeHigh = bar_index
var line li = na

f_drawLine() =>
    _li_color = show_zigzag ? zigzag_color : color.new(#ffffff,100)
    line.new(timeHigh - swing_length, lastHigh, timeLow - swing_length, lastLow, xloc.bar_index, color=_li_color, width=2)

if dirUp
    if f_isMin(swing_length) and low[swing_length] < lastLow
        lastLow := low[swing_length]
        timeLow := bar_index
        line.delete(li)
        li := f_drawLine()
        li

    if f_isMax(swing_length) and high[swing_length] > lastLow
        lastHigh := high[swing_length]
        timeHigh := bar_index
        dirUp := false
        li := f_drawLine()
        li

if not dirUp
    if f_isMax(swing_length) and high[swing_length] > lastHigh
        lastHigh := high[swing_length]
        timeHigh := bar_index
        line.delete(li)
        li := f_drawLine()
        li
    if f_isMin(swing_length) and low[swing_length] < lastHigh
        lastLow := low[swing_length]
        timeLow := bar_index
        dirUp := true
        li := f_drawLine()
        if f_isMax(swing_length) and high[swing_length] > lastLow
            lastHigh := high[swing_length]
            timeHigh := bar_index
            dirUp := false
            li := f_drawLine()
            li
// if barstate.islast
    // label.new(x = bar_index + 10, y = close[1], text = str.tostring( array.size(current_supply_poi) ))
//     label.new(x = bar_index + 20, y = close[1], text = str.tostring( box.get_bottom( array.get(current_supply_box, 0))))
//     label.new(x = bar_index + 30, y = close[1], text = str.tostring( box.get_bottom( array.get(current_supply_box, 1))))
//     label.new(x = bar_index + 40, y = close[1], text = str.tostring( box.get_bottom( array.get(current_supply_box, 2))))
//     label.new(x = bar_index + 50, y = close[1], text = str.tostring( box.get_bottom( array.get(current_supply_box, 3))))
//     label.new(x = bar_index + 60, y = close[1], text = str.tostring( box.get_bottom( array.get(current_supply_box, 4))))

scannersignal = input.string(defval="Arz Bölgesi", title="Signal ?", options=["Arz Bölgesi","Talep Bölgesi"], group="Signal AYARLAR")
scannerswich = switch str.tostring(scannersignal)
    "Arz Bölgesi" => condition_arz
    "Talep Bölgesi"=> condition_talep

func() =>
    cond = scannerswich
    [close,cond]

c1 = input.symbol(title='1', defval='BIST:AVOD',group = "1. Grup Hisseleri")
c2 = input.symbol(title='2', defval='BIST:ACSEL')
c3 = input.symbol(title='3', defval='BIST:ADESE')
c4 = input.symbol(title='4', defval='BIST:AFYON')
c5 = input.symbol(title='5', defval='BIST:AHGAZ')
c6 = input.symbol(title='6', defval='BIST:AKCNS')
c7 = input.symbol(title='7', defval='BIST:ATEKS')
c8 = input.symbol(title='8', defval='BIST:AKSGY')
c9 = input.symbol(title='9', defval='BIST:AKMGY')
c10 = input.symbol(title='10', defval='BIST:AKSA')
c11 = input.symbol(title='11', defval='BIST:AKSEN')
c12 = input.symbol(title='12', defval='BIST:ALBRK')
c13 = input.symbol(title='13', defval='BIST:ALCTL')
c14 = input.symbol(title='14', defval='BIST:ALFAS')
c15 = input.symbol(title='15', defval='BIST:ALKA')
c16 = input.symbol(title='16', defval='BIST:ALKIM')
c17 = input.symbol(title='17', defval='BIST:ANELE')
c18 = input.symbol(title='18', defval='BIST:ARDYZ')
c19 = input.symbol(title='19', defval='BIST:ARENA')
c20 = input.symbol(title='20', defval='BIST:INGRM')
c21 = input.symbol(title='21', defval='BIST:ASELS')
c22 = input.symbol(title='22', defval='BIST:ASTOR')
c23 = input.symbol(title='23', defval='BIST:ATAGY')
c24 = input.symbol(title='24', defval='BIST:ATATP')
c25 = input.symbol(title='25', defval='BIST:BAKAB')
c26 = input.symbol(title='26', defval='BIST:BNTAS')
c27 = input.symbol(title='27', defval='BIST:BANVT')
c28 = input.symbol(title='28', defval='BIST:BARMA')
c29 = input.symbol(title='29', defval='BIST:BASGZ')
c30 = input.symbol(title='30', defval='BIST:BAYRK')
c31 = input.symbol(title='31', defval='BIST:BERA')
c32 = input.symbol(title='32', defval='BIST:BRKSN')
c33 = input.symbol(title='33', defval='BIST:BEYAZ')
c34 = input.symbol(title='34', defval='BIST:BIENY')
c35 = input.symbol(title='35', defval='BIST:BLCYT')
c36 = input.symbol(title='36', defval='BIST:BIMAS')
c37 = input.symbol(title='37', defval='BIST:BIOEN')
c38 = input.symbol(title='38', defval='BIST:BRLSM')
c39 = input.symbol(title='39', defval='BIST:BOBET')
c40 = input.symbol(title='40', defval='BIST:BOSSA')

d1 = input.symbol(title='1', defval='BIST:BURCE',group = "2. Grup Hisseleri")
d2 = input.symbol(title='2', defval='BIST:BURVA')
d3 = input.symbol(title='3', defval='BIST:BUCIM')
d4 = input.symbol(title='4', defval='BIST:CANTE')
d5 = input.symbol(title='5', defval='BIST:CLEBI')
d6 = input.symbol(title='6', defval='BIST:CELHA')
d7 = input.symbol(title='7', defval='BIST:CEMAS')
d8 = input.symbol(title='8', defval='BIST:CEMTS')
d9 = input.symbol(title='9', defval='BIST:CMBTN')
d10 = input.symbol(title='10', defval='BIST:CIMSA')
d11 = input.symbol(title='11', defval='BIST:CONSE')
d12 = input.symbol(title='12', defval='BIST:COSMO')
d13 = input.symbol(title='13', defval='BIST:CVKMD')
d14 = input.symbol(title='14', defval='BIST:CWENE')
d15 = input.symbol(title='15', defval='BIST:DAPGM')
d16 = input.symbol(title='16', defval='BIST:DARDL')
d17 = input.symbol(title='17', defval='BIST:DGATE')
d18 = input.symbol(title='18', defval='BIST:DESA')
d19 = input.symbol(title='19', defval='BIST:DESPC')
d20 = input.symbol(title='20', defval='BIST:DNISI')
d21 = input.symbol(title='21', defval='BIST:DITAS')
d22 = input.symbol(title='22', defval='BIST:DGNMO')
d23 = input.symbol(title='23', defval='BIST:ARASE')
d24 = input.symbol(title='24', defval='BIST:DGGYO')
d25 = input.symbol(title='25', defval='BIST:DOAS')
d26 = input.symbol(title='26', defval='BIST:DOGUB')
d27 = input.symbol(title='27', defval='BIST:DYOBY')
d28 = input.symbol(title='28', defval='BIST:EDATA')
d29 = input.symbol(title='29', defval='BIST:EGEEN')
d30 = input.symbol(title='30', defval='BIST:EGGUB')
d31 = input.symbol(title='31', defval='BIST:EGPRO')
d32 = input.symbol(title='32', defval='BIST:EKSUN')
d33 = input.symbol(title='33', defval='BIST:ELITE')
d34 = input.symbol(title='34', defval='BIST:ENJSA')
d35 = input.symbol(title='35', defval='BIST:ERCB')
d36 = input.symbol(title='36', defval='BIST:EREGL')
d37 = input.symbol(title='37', defval='BIST:ERSU')
d38 = input.symbol(title='38', defval='BIST:ESCOM')
d39 = input.symbol(title='39', defval='BIST:TEZOL')
d40 = input.symbol(title='40', defval='BIST:EUPWR')

e1 = input.symbol(title='1', defval='BIST:EYGYO',group = "3. Grup Hisseleri")
e2 = input.symbol(title='2', defval='BIST:FMIZP')
e3 = input.symbol(title='3', defval='BIST:FONET')
e4 = input.symbol(title='4', defval='BIST:FORMT')
e5 = input.symbol(title='5', defval='BIST:FORTE')
e6 = input.symbol(title='6', defval='BIST:GWIND')
e7 = input.symbol(title='7', defval='BIST:GEDZA')
e8 = input.symbol(title='8', defval='BIST:GENIL')
e9 = input.symbol(title='9', defval='BIST:GENTS')
e10 = input.symbol(title='10', defval='BIST:GEREL')
e11 = input.symbol(title='11', defval='BIST:GMTAS')
e12 = input.symbol(title='12', defval='BIST:GESAN')
e13 = input.symbol(title='13', defval='BIST:GOODY')
e14 = input.symbol(title='14', defval='BIST:GRTRK')
e15 = input.symbol(title='15', defval='BIST:GUBRF')
e16 = input.symbol(title='16', defval='BIST:HLGYO')
e17 = input.symbol(title='17', defval='BIST:HKTM')
e18 = input.symbol(title='18', defval='BIST:HUBVC')
e19 = input.symbol(title='19', defval='BIST:HUNER')
e20 = input.symbol(title='20', defval='BIST:IDGYO')
e21 = input.symbol(title='21', defval='BIST:IHEVA')
e22 = input.symbol(title='22', defval='BIST:IHLGM')
e23 = input.symbol(title='23', defval='BIST:IHGZT')
e24 = input.symbol(title='24', defval='BIST:IHYAY')
e25 = input.symbol(title='25', defval='BIST:IMASM')
e26 = input.symbol(title='26', defval='BIST:INTEM')
e27 = input.symbol(title='27', defval='BIST:INVES')
e28 = input.symbol(title='28', defval='BIST:ISSEN')
e29 = input.symbol(title='29', defval='BIST:ISKPL')
e30 = input.symbol(title='30', defval='BIST:IEYHO')
e31 = input.symbol(title='31', defval='BIST:ISDMR')
e32 = input.symbol(title='32', defval='BIST:IZINV')
e33 = input.symbol(title='33', defval='BIST:IZFAS')
e34 = input.symbol(title='34', defval='BIST:JANTS')
e35 = input.symbol(title='35', defval='BIST:KLKIM')
e36 = input.symbol(title='36', defval='BIST:KRDMA')
e37 = input.symbol(title='37', defval='BIST:KRDMB')
e38 = input.symbol(title='38', defval='BIST:KRDMD')
e39 = input.symbol(title='39', defval='BIST:KARSN')
e40 = input.symbol(title='40', defval='BIST:KRTEK')

f1 = input.symbol(title='1', defval='BIST:KARYE',group = "4. Grup Hisseleri")
f2 = input.symbol(title='2', defval='BIST:KTLEV')
f3 = input.symbol(title='3', defval='BIST:KATMR')
f4 = input.symbol(title='4', defval='BIST:KAYSE')
f5 = input.symbol(title='5', defval='BIST:KERVT')
f6 = input.symbol(title='6', defval='BIST:KRVGD')
f7 = input.symbol(title='7', defval='BIST:KMPUR')
f8 = input.symbol(title='8', defval='BIST:KZBGY')
f9 = input.symbol(title='9', defval='BIST:KCAER')
f10 = input.symbol(title='10', defval='BIST:KNFRT')
f11 = input.symbol(title='11', defval='BIST:KONTR')
f12 = input.symbol(title='12', defval='BIST:KONYA')
f13 = input.symbol(title='13', defval='BIST:KONKA')
f14 = input.symbol(title='14', defval='BIST:KGYO')
f15 = input.symbol(title='15', defval='BIST:KORDS')
f16 = input.symbol(title='16', defval='BIST:KRGYO')
f17 = input.symbol(title='17', defval='BIST:KRPLS')
f18 = input.symbol(title='18', defval='BIST:KOPOL')
f19 = input.symbol(title='19', defval='BIST:KRSTL')
f20 = input.symbol(title='20', defval='BIST:KRONT')
f21 = input.symbol(title='21', defval='BIST:KUTPO')
f22 = input.symbol(title='22', defval='BIST:KUYAS')
f23 = input.symbol(title='23', defval='BIST:LINK')
f24 = input.symbol(title='24', defval='BIST:LKMNH')
f25 = input.symbol(title='25', defval='BIST:LUKSK')
f26 = input.symbol(title='26', defval='BIST:MAKIM')
f27 = input.symbol(title='27', defval='BIST:MAKTK')
f28 = input.symbol(title='28', defval='BIST:MANAS')
f29 = input.symbol(title='29', defval='BIST:MTRKS')
f30 = input.symbol(title='30', defval='BIST:MAVI')
f31 = input.symbol(title='31', defval='BIST:MEDTR')
f32 = input.symbol(title='32', defval='BIST:MEGAP')
f33 = input.symbol(title='33', defval='BIST:MNDRS')
f34 = input.symbol(title='34', defval='BIST:MERCN')
f35 = input.symbol(title='35', defval='BIST:MERKO')
f36 = input.symbol(title='36', defval='BIST:MIATK')
f37 = input.symbol(title='37', defval='BIST:MIPAZ')
f38 = input.symbol(title='38', defval='BIST:MSGYO')
f39 = input.symbol(title='39', defval='BIST:MPARK')
f40 = input.symbol(title='40', defval='BIST:MOBTL')

g1 = input.symbol(title='1', defval='BIST:MNDTR',group = "5. Grup Hisseleri")
g2 = input.symbol(title='2', defval='BIST:EGEPO')
g3 = input.symbol(title='3', defval='BIST:NTGAZ')
g4 = input.symbol(title='4', defval='BIST:NETAS')
g5 = input.symbol(title='5', defval='BIST:NIBAS')
g6 = input.symbol(title='6', defval='BIST:NUHCM')
g7 = input.symbol(title='7', defval='BIST:NUGYO')
g8 = input.symbol(title='8', defval='BIST:ODAS')
g9 = input.symbol(title='9', defval='BIST:ONCSM')
g10 = input.symbol(title='10', defval='BIST:ORGE')
g11 = input.symbol(title='11', defval='BIST:OSTIM')
g12 = input.symbol(title='12', defval='BIST:OTKAR')
g13 = input.symbol(title='13', defval='BIST:OYAKC')
g14 = input.symbol(title='14', defval='BIST:OYLUM')
g15 = input.symbol(title='15', defval='BIST:OZGYO')
g16 = input.symbol(title='16', defval='BIST:OZRDN')
g17 = input.symbol(title='17', defval='BIST:OZSUB')
g18 = input.symbol(title='18', defval='BIST:PNLSN')
g19 = input.symbol(title='19', defval='BIST:PAGYO')
g20 = input.symbol(title='20', defval='BIST:PRDGS')
g21 = input.symbol(title='21', defval='BIST:PASEU')
g22 = input.symbol(title='22', defval='BIST:PSGYO')
g23 = input.symbol(title='23', defval='BIST:PCILT')
g24 = input.symbol(title='24', defval='BIST:PGSUS')
g25 = input.symbol(title='25', defval='BIST:PEKGY')
g26 = input.symbol(title='26', defval='BIST:PENGD')
g27 = input.symbol(title='27', defval='BIST:PENTA')
g28 = input.symbol(title='28', defval='BIST:PETUN')
g29 = input.symbol(title='29', defval='BIST:PNSUT')
g30 = input.symbol(title='30', defval='BIST:PKART')
g31 = input.symbol(title='31', defval='BIST:PLTUR')
g32 = input.symbol(title='32', defval='BIST:POLHO')
g33 = input.symbol(title='33', defval='BIST:POLTK')
g34 = input.symbol(title='34', defval='BIST:RNPOL')
g35 = input.symbol(title='35', defval='BIST:RALYH')
g36 = input.symbol(title='36', defval='BIST:ICUGS')
g37 = input.symbol(title='37', defval='BIST:RODRG')
g38 = input.symbol(title='38', defval='BIST:RUBNS')
g39 = input.symbol(title='39', defval='BIST:SAFKR')
g40 = input.symbol(title='40', defval='BIST:SNICA')

h1 = input.symbol(title='1', defval='BIST:SANFM',group = "6. Grup Hisseleri")
h2 = input.symbol(title='2', defval='BIST:SANKO')
h3 = input.symbol(title='3', defval='BIST:SAMAT')
h4 = input.symbol(title='4', defval='BIST:SASA')
h5 = input.symbol(title='5', defval='BIST:SAYAS')
h6 = input.symbol(title='6', defval='BIST:SEKUR')
h7 = input.symbol(title='7', defval='BIST:SELEC')
h8 = input.symbol(title='8', defval='BIST:SELGD')
h9 = input.symbol(title='9', defval='BIST:SELVA')
h10 = input.symbol(title='10', defval='BIST:SRVGY')
h11 = input.symbol(title='11', defval='BIST:SILVR')
h12 = input.symbol(title='12', defval='BIST:SNGYO')
h13 = input.symbol(title='13', defval='BIST:SMRTG')
h14 = input.symbol(title='14', defval='BIST:SMART')
h15 = input.symbol(title='15', defval='BIST:SOKE')
h16 = input.symbol(title='16', defval='BIST:SONME')
h17 = input.symbol(title='17', defval='BIST:SUNTK')
h18 = input.symbol(title='18', defval='BIST:SUWEN')
h19 = input.symbol(title='19', defval='BIST:TKFEN')
h20 = input.symbol(title='20', defval='BIST:TKNSA')
h21 = input.symbol(title='21', defval='BIST:TMPOL')
h22 = input.symbol(title='22', defval='BIST:TGSAS')
h23 = input.symbol(title='23', defval='BIST:TDGYO')
h24 = input.symbol(title='24', defval='BIST:TSGYO')
h25 = input.symbol(title='25', defval='BIST:TUCLK')
h26 = input.symbol(title='26', defval='BIST:TUKAS')
h27 = input.symbol(title='27', defval='BIST:TMSN')
h28 = input.symbol(title='28', defval='BIST:TUPRS')
h29 = input.symbol(title='29', defval='BIST:TRCAS')
h30 = input.symbol(title='30', defval='BIST:TUREX')
h31 = input.symbol(title='31', defval='BIST:THYAO')
h32 = input.symbol(title='32', defval='BIST:TRILC')
h33 = input.symbol(title='33', defval='BIST:PRKAB')
h34 = input.symbol(title='34', defval='BIST:TTRAK')
h35 = input.symbol(title='35', defval='BIST:TURGG')
h36 = input.symbol(title='36', defval='BIST:ULUSE')
h37 = input.symbol(title='37', defval='BIST:ULUUN')
h38 = input.symbol(title='38', defval='BIST:USAK')
h39 = input.symbol(title='39', defval='BIST:VAKKO')
h40 = input.symbol(title='40', defval='BIST:VBTYZ')

j1 = input.symbol(title='1', defval='BIST:VERUS',group = "7. Grup Hisseleri")
j2 = input.symbol(title='2', defval='BIST:VERTU')
j3 = input.symbol(title='3', defval='BIST:VESBE')
j4 = input.symbol(title='4', defval='BIST:YAPRK')
j5 = input.symbol(title='5', defval='BIST:YATAS')
j6 = input.symbol(title='6', defval='BIST:YYLGD')
j7 = input.symbol(title='7', defval='BIST:YEOTK')
j8 = input.symbol(title='8', defval='BIST:YUNSA')
j9 = input.symbol(title='9', defval='BIST:ZEDUR')
j10 = input.symbol(title='10', defval='BIST:XU100')
j11 = input.symbol(title='11', defval='')
j12 = input.symbol(title='12', defval='')
j13 = input.symbol(title='13', defval='')
j14 = input.symbol(title='14', defval='')
j15 = input.symbol(title='15', defval='')
j16 = input.symbol(title='16', defval='')
j17 = input.symbol(title='17', defval='')
j18 = input.symbol(title='18', defval='')
j19 = input.symbol(title='19', defval='')
j20 = input.symbol(title='20', defval='')
j21 = input.symbol(title='21', defval='')
j22 = input.symbol(title='22', defval='')
j23 = input.symbol(title='23', defval='')
j24 = input.symbol(title='24', defval='')
j25 = input.symbol(title='25', defval='')
j26 = input.symbol(title='26', defval='')
j27 = input.symbol(title='27', defval='')
j28 = input.symbol(title='28', defval='')
j29 = input.symbol(title='29', defval='')
j30 = input.symbol(title='30', defval='')
j31 = input.symbol(title='31', defval='')
j32 = input.symbol(title='32', defval='')
j33 = input.symbol(title='33', defval='')
j34 = input.symbol(title='34', defval='')
j35 = input.symbol(title='35', defval='')
j36 = input.symbol(title='36', defval='')
j37 = input.symbol(title='37', defval='')
j38 = input.symbol(title='38', defval='')
j39 = input.symbol(title='39', defval='')
j40 = input.symbol(title='40', defval='')


//GRUP VE TARANACAK HİSSE SAYISINI AYNI ŞEKİLDE DİLEDİĞİNİZ GİBİ ARTIRABİLİRSİNİZ.

a1 = gurupSec == '1' ? c1 : gurupSec == '2' ? d1 : gurupSec == '3' ? e1 : gurupSec == '4' ? f1 : gurupSec == '5' ? g1 : gurupSec == '6' ? h1 : gurupSec == '7' ? j1 : na
a2 = gurupSec == '1' ? c2 : gurupSec == '2' ? d2 : gurupSec == '3' ? e2 : gurupSec == '4' ? f2 : gurupSec == '5' ? g2 : gurupSec == '6' ? h2 : gurupSec == '7' ? j2 : na
a3 = gurupSec == '1' ? c3 : gurupSec == '2' ? d3 : gurupSec == '3' ? e3 : gurupSec == '4' ? f3 : gurupSec == '5' ? g3 : gurupSec == '6' ? h3 : gurupSec == '7' ? j3 : na
a4 = gurupSec == '1' ? c4 : gurupSec == '2' ? d4 : gurupSec == '3' ? e4 : gurupSec == '4' ? f4 : gurupSec == '5' ? g4 : gurupSec == '6' ? h4 : gurupSec == '7' ? j4 : na
a5 = gurupSec == '1' ? c5 : gurupSec == '2' ? d5 : gurupSec == '3' ? e5 : gurupSec == '4' ? f5 : gurupSec == '5' ? g5 : gurupSec == '6' ? h5 : gurupSec == '7' ? j5 : na
a6 = gurupSec == '1' ? c6 : gurupSec == '2' ? d6 : gurupSec == '3' ? e6 : gurupSec == '4' ? f6 : gurupSec == '5' ? g6 : gurupSec == '6' ? h6 : gurupSec == '7' ? j6 : na
a7 = gurupSec == '1' ? c7 : gurupSec == '2' ? d7 : gurupSec == '3' ? e7 : gurupSec == '4' ? f7 : gurupSec == '5' ? g7 : gurupSec == '6' ? h7 : gurupSec == '7' ? j7 : na
a8 = gurupSec == '1' ? c8 : gurupSec == '2' ? d8 : gurupSec == '3' ? e8 : gurupSec == '4' ? f8 : gurupSec == '5' ? g8 : gurupSec == '6' ? h8 : gurupSec == '7' ? j8 : na
a9 = gurupSec == '1' ? c9 : gurupSec == '2' ? d9 : gurupSec == '3' ? e9 : gurupSec == '4' ? f9 : gurupSec == '5' ? g9 : gurupSec == '6' ? h9 : gurupSec == '7' ? j9 : na
a10 = gurupSec == '1' ? c10 : gurupSec == '2' ? d10 : gurupSec == '3' ? e10 : gurupSec == '4' ? f10 : gurupSec == '5' ? g10 : gurupSec == '6' ? h10 : gurupSec == '7' ? j10 : na
a11 = gurupSec == '1' ? c11 : gurupSec == '2' ? d11 : gurupSec == '3' ? e11 : gurupSec == '4' ? f11 : gurupSec == '5' ? g11 : gurupSec == '6' ? h11 : gurupSec == '7' ? j11 : na
a12 = gurupSec == '1' ? c12 : gurupSec == '2' ? d12 : gurupSec == '3' ? e12 : gurupSec == '4' ? f12 : gurupSec == '5' ? g12 : gurupSec == '6' ? h12 : gurupSec == '7' ? j12 : na
a13 = gurupSec == '1' ? c13 : gurupSec == '2' ? d13 : gurupSec == '3' ? e13 : gurupSec == '4' ? f13 : gurupSec == '5' ? g13 : gurupSec == '6' ? h13 : gurupSec == '7' ? j13 : na
a14 = gurupSec == '1' ? c14 : gurupSec == '2' ? d14 : gurupSec == '3' ? e14 : gurupSec == '4' ? f14 : gurupSec == '5' ? g14 : gurupSec == '6' ? h14 : gurupSec == '7' ? j14 : na
a15 = gurupSec == '1' ? c15 : gurupSec == '2' ? d15 : gurupSec == '3' ? e15 : gurupSec == '4' ? f15 : gurupSec == '5' ? g15 : gurupSec == '6' ? h15 : gurupSec == '7' ? j15 : na
a16 = gurupSec == '1' ? c16 : gurupSec == '2' ? d16 : gurupSec == '3' ? e16 : gurupSec == '4' ? f16 : gurupSec == '5' ? g16 : gurupSec == '6' ? h16 : gurupSec == '7' ? j16 : na
a17 = gurupSec == '1' ? c17 : gurupSec == '2' ? d17 : gurupSec == '3' ? e17 : gurupSec == '4' ? f17 : gurupSec == '5' ? g17 : gurupSec == '6' ? h17 : gurupSec == '7' ? j17 : na
a18 = gurupSec == '1' ? c18 : gurupSec == '2' ? d18 : gurupSec == '3' ? e18 : gurupSec == '4' ? f18 : gurupSec == '5' ? g18 : gurupSec == '6' ? h18 : gurupSec == '7' ? j18 : na
a19 = gurupSec == '1' ? c19 : gurupSec == '2' ? d19 : gurupSec == '3' ? e19 : gurupSec == '4' ? f19 : gurupSec == '5' ? g19 : gurupSec == '6' ? h19 : gurupSec == '7' ? j19 : na
a20 = gurupSec == '1' ? c20 : gurupSec == '2' ? d20 : gurupSec == '3' ? e20 : gurupSec == '4' ? f20 : gurupSec == '5' ? g20 : gurupSec == '6' ? h20 : gurupSec == '7' ? j20 : na
a21 = gurupSec == '1' ? c21 : gurupSec == '2' ? d21 : gurupSec == '3' ? e21 : gurupSec == '4' ? f21 : gurupSec == '5' ? g21 : gurupSec == '6' ? h21 : gurupSec == '7' ? j21 : na
a22 = gurupSec == '1' ? c22 : gurupSec == '2' ? d22 : gurupSec == '3' ? e22 : gurupSec == '4' ? f22 : gurupSec == '5' ? g22 : gurupSec == '6' ? h22 : gurupSec == '7' ? j22 : na
a23 = gurupSec == '1' ? c23 : gurupSec == '2' ? d23 : gurupSec == '3' ? e23 : gurupSec == '4' ? f23 : gurupSec == '5' ? g23 : gurupSec == '6' ? h23 : gurupSec == '7' ? j23 : na
a24 = gurupSec == '1' ? c24 : gurupSec == '2' ? d24 : gurupSec == '3' ? e24 : gurupSec == '4' ? f24 : gurupSec == '5' ? g24 : gurupSec == '6' ? h24 : gurupSec == '7' ? j24 : na
a25 = gurupSec == '1' ? c25 : gurupSec == '2' ? d25 : gurupSec == '3' ? e25 : gurupSec == '4' ? f25 : gurupSec == '5' ? g25 : gurupSec == '6' ? h25 : gurupSec == '7' ? j25 : na
a26 = gurupSec == '1' ? c26 : gurupSec == '2' ? d26 : gurupSec == '3' ? e26 : gurupSec == '4' ? f26 : gurupSec == '5' ? g26 : gurupSec == '6' ? h26 : gurupSec == '7' ? j26 : na
a27 = gurupSec == '1' ? c27 : gurupSec == '2' ? d27 : gurupSec == '3' ? e27 : gurupSec == '4' ? f27 : gurupSec == '5' ? g27 : gurupSec == '6' ? h27 : gurupSec == '7' ? j27 : na
a28 = gurupSec == '1' ? c28 : gurupSec == '2' ? d28 : gurupSec == '3' ? e28 : gurupSec == '4' ? f28 : gurupSec == '5' ? g28 : gurupSec == '6' ? h28 : gurupSec == '7' ? j28 : na
a29 = gurupSec == '1' ? c29 : gurupSec == '2' ? d29 : gurupSec == '3' ? e29 : gurupSec == '4' ? f29 : gurupSec == '5' ? g29 : gurupSec == '6' ? h29 : gurupSec == '7' ? j29 : na
a30 = gurupSec == '1' ? c30 : gurupSec == '2' ? d30 : gurupSec == '3' ? e30 : gurupSec == '4' ? f30 : gurupSec == '5' ? g30 : gurupSec == '6' ? h30 : gurupSec == '7' ? j30 : na
a31 = gurupSec == '1' ? c31 : gurupSec == '2' ? d31 : gurupSec == '3' ? e31 : gurupSec == '4' ? f31 : gurupSec == '5' ? g31 : gurupSec == '6' ? h31 : gurupSec == '7' ? j31: na
a32 = gurupSec == '1' ? c32 : gurupSec == '2' ? d32 : gurupSec == '3' ? e32 : gurupSec == '4' ? f32 : gurupSec == '5' ? g32 : gurupSec == '6' ? h32 : gurupSec == '7' ? j32 : na
a33 = gurupSec == '1' ? c33 : gurupSec == '2' ? d33 : gurupSec == '3' ? e33 : gurupSec == '4' ? f33 : gurupSec == '5' ? g33 : gurupSec == '6' ? h33 : gurupSec == '7' ? j33 : na
a34 = gurupSec == '1' ? c34 : gurupSec == '2' ? d34 : gurupSec == '3' ? e34 : gurupSec == '4' ? f34 : gurupSec == '5' ? g34 : gurupSec == '6' ? h34 : gurupSec == '7' ? j34 : na
a35 = gurupSec == '1' ? c35 : gurupSec == '2' ? d35 : gurupSec == '3' ? e35 : gurupSec == '4' ? f35 : gurupSec == '5' ? g35 : gurupSec == '6' ? h35 : gurupSec == '7' ? j35 : na
a36 = gurupSec == '1' ? c36 : gurupSec == '2' ? d36 : gurupSec == '3' ? e36 : gurupSec == '4' ? f36 : gurupSec == '5' ? g36 : gurupSec == '6' ? h36 : gurupSec == '7' ? j36 : na
a37 = gurupSec == '1' ? c37 : gurupSec == '2' ? d37 : gurupSec == '3' ? e37 : gurupSec == '4' ? f37 : gurupSec == '5' ? g37 : gurupSec == '6' ? h37 : gurupSec == '7' ? j37 : na
a38 = gurupSec == '1' ? c38 : gurupSec == '2' ? d38 : gurupSec == '3' ? e38 : gurupSec == '4' ? f38 : gurupSec == '5' ? g38 : gurupSec == '6' ? h38 : gurupSec == '7' ? j38 : na
a39 = gurupSec == '1' ? c39 : gurupSec == '2' ? d39 : gurupSec == '3' ? e39 : gurupSec == '4' ? f39 : gurupSec == '5' ? g39 : gurupSec == '6' ? h39 : gurupSec == '7' ? j39 : na
a40 = gurupSec == '1' ? c40 : gurupSec == '2' ? d40 : gurupSec == '3' ? e40 : gurupSec == '4' ? f40 : gurupSec == '5' ? g40 : gurupSec == '6' ? h40 : gurupSec == '7' ? j40 : na

[v1,s1] = request.security(a1, per, func())
[v2,s2] = request.security(a2, per, func())
[v3,s3] = request.security(a3, per, func())
[v4,s4] = request.security(a4, per, func())
[v5,s5] = request.security(a5, per, func())
[v6,s6] = request.security(a6, per, func())
[v7,s7] = request.security(a7, per, func())
[v8,s8] = request.security(a8, per, func())
[v9,s9] = request.security(a9, per, func())
[v10,s10] = request.security(a10, per, func())
[v11,s11] = request.security(a11, per, func())
[v12,s12] = request.security(a12, per, func())
[v13,s13] = request.security(a13, per, func())
[v14,s14] = request.security(a14, per, func())
[v15,s15] = request.security(a15, per, func())
[v16,s16] = request.security(a16, per, func())
[v17,s17] = request.security(a17, per, func())
[v18,s18] = request.security(a18, per, func())
[v19,s19] = request.security(a19, per, func())
[v20,s20] = request.security(a20, per, func())
[v21,s21] = request.security(a21, per, func())
[v22,s22] = request.security(a22, per, func())
[v23,s23] = request.security(a23, per, func())
[v24,s24] = request.security(a24, per, func())
[v25,s25] = request.security(a25, per, func())
[v26,s26] = request.security(a26, per, func())
[v27,s27] = request.security(a27, per, func())
[v28,s28] = request.security(a28, per, func())
[v29,s29] = request.security(a29, per, func())
[v30,s30] = request.security(a30, per, func())
[v31,s31] = request.security(a31, per, func())
[v32,s32] = request.security(a32, per, func())
[v33,s33] = request.security(a33, per, func())
[v34,s34] = request.security(a34, per, func())
[v35,s35] = request.security(a35, per, func())
[v36,s36] = request.security(a36, per, func())
[v37,s37] = request.security(a37, per, func())
[v38,s38] = request.security(a38, per, func())
[v39,s39] = request.security(a39, per, func())
[v40,s40] = request.security(a40, per, func())

scr_label = 'TARAMA\n'
scr_label := s1 ? scr_label + syminfo.ticker(a1) + ' ' + str.tostring(v1) + '\n' : scr_label
scr_label := s2 ? scr_label + syminfo.ticker(a2) + ' ' + str.tostring(v2) + '\n' : scr_label
scr_label := s3 ? scr_label + syminfo.ticker(a3) + ' ' + str.tostring(v3) + '\n' : scr_label
scr_label := s4 ? scr_label + syminfo.ticker(a4) + ' ' + str.tostring(v4) + '\n' : scr_label
scr_label := s5 ? scr_label + syminfo.ticker(a5) + ' ' + str.tostring(v5) + '\n' : scr_label
scr_label := s6 ? scr_label + syminfo.ticker(a6) + ' ' + str.tostring(v6) + '\n' : scr_label
scr_label := s7 ? scr_label + syminfo.ticker(a7) + ' ' + str.tostring(v7) + '\n' : scr_label
scr_label := s8 ? scr_label + syminfo.ticker(a8) + ' ' + str.tostring(v8) + '\n' : scr_label
scr_label := s9 ? scr_label + syminfo.ticker(a9) + ' ' + str.tostring(v9) + '\n' : scr_label
scr_label := s10 ? scr_label + syminfo.ticker(a10) + ' ' + str.tostring(v10) + '\n' : scr_label
scr_label := s11 ? scr_label + syminfo.ticker(a11) + ' ' + str.tostring(v11) + '\n' : scr_label
scr_label := s12 ? scr_label + syminfo.ticker(a12) + ' ' + str.tostring(v12) + '\n' : scr_label
scr_label := s13 ? scr_label + syminfo.ticker(a13) + ' ' + str.tostring(v13) + '\n' : scr_label
scr_label := s14 ? scr_label + syminfo.ticker(a14) + ' ' + str.tostring(v14) + '\n' : scr_label
scr_label := s15 ? scr_label + syminfo.ticker(a15) + ' ' + str.tostring(v15) + '\n' : scr_label
scr_label := s16 ? scr_label + syminfo.ticker(a16) + ' ' + str.tostring(v16) + '\n' : scr_label
scr_label := s17 ? scr_label + syminfo.ticker(a17) + ' ' + str.tostring(v17) + '\n' : scr_label
scr_label := s18 ? scr_label + syminfo.ticker(a18) + ' ' + str.tostring(v18) + '\n' : scr_label
scr_label := s19 ? scr_label + syminfo.ticker(a19) + ' ' + str.tostring(v19) + '\n' : scr_label
scr_label := s20 ? scr_label + syminfo.ticker(a20) + ' ' + str.tostring(v20) + '\n' : scr_label
scr_label := s21 ? scr_label + syminfo.ticker(a21) + ' ' + str.tostring(v21) + '\n' : scr_label
scr_label := s22 ? scr_label + syminfo.ticker(a22) + ' ' + str.tostring(v22) + '\n' : scr_label
scr_label := s23 ? scr_label + syminfo.ticker(a23) + ' ' + str.tostring(v23) + '\n' : scr_label
scr_label := s24 ? scr_label + syminfo.ticker(a24) + ' ' + str.tostring(v24) + '\n' : scr_label
scr_label := s25 ? scr_label + syminfo.ticker(a25) + ' ' + str.tostring(v25) + '\n' : scr_label
scr_label := s26 ? scr_label + syminfo.ticker(a26) + ' ' + str.tostring(v26) + '\n' : scr_label
scr_label := s27 ? scr_label + syminfo.ticker(a27) + ' ' + str.tostring(v27) + '\n' : scr_label
scr_label := s28 ? scr_label + syminfo.ticker(a28) + ' ' + str.tostring(v28) + '\n' : scr_label
scr_label := s29 ? scr_label + syminfo.ticker(a29) + ' ' + str.tostring(v29) + '\n' : scr_label
scr_label := s30 ? scr_label + syminfo.ticker(a30) + ' ' + str.tostring(v30) + '\n' : scr_label
scr_label := s31 ? scr_label + syminfo.ticker(a31) + ' ' + str.tostring(v31) + '\n' : scr_label
scr_label := s32 ? scr_label + syminfo.ticker(a32) + ' ' + str.tostring(v32) + '\n' : scr_label
scr_label := s33 ? scr_label + syminfo.ticker(a33) + ' ' + str.tostring(v33) + '\n' : scr_label
scr_label := s34 ? scr_label + syminfo.ticker(a34) + ' ' + str.tostring(v34) + '\n' : scr_label
scr_label := s35 ? scr_label + syminfo.ticker(a35) + ' ' + str.tostring(v35) + '\n' : scr_label
scr_label := s36 ? scr_label + syminfo.ticker(a36) + ' ' + str.tostring(v36) + '\n' : scr_label
scr_label := s37 ? scr_label + syminfo.ticker(a37) + ' ' + str.tostring(v37) + '\n' : scr_label
scr_label := s38 ? scr_label + syminfo.ticker(a38) + ' ' + str.tostring(v38) + '\n' : scr_label
scr_label := s39 ? scr_label + syminfo.ticker(a39) + ' ' + str.tostring(v39) + '\n' : scr_label
scr_label := s40 ? scr_label + syminfo.ticker(a40) + ' ' + str.tostring(v40) + '\n' : scr_label

lab_1 = label.new(bar_index + loc, close, scr_label, color=color.green, textcolor=color.white, style=label.style_label_center)
label.delete(lab_1[1])

if str.length(scr_label) > 8
    alert(scr_label,alert.freq_once_per_bar_close)
Leave a Comment