Index_and_Commodity_Prices
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © volkankocabas

//@version=5
indicator("Endeks ve Emtia Fiyatları", overlay = true)

dow= request.security("DJI", "D",close, ignore_invalid_symbol=true)
dow1=request.security("DJI", "D",close[1], ignore_invalid_symbol=true)
dax= request.security("DAX", "D",close, ignore_invalid_symbol=true)
dax1= request.security("DAX", "D",close[1], ignore_invalid_symbol=true)
vix= request.security("VIX", "D",close, ignore_invalid_symbol=true)
vix1= request.security("VIX", "D",close[1], ignore_invalid_symbol=true)
eurusd= request.security("EURUSD", "D",close, ignore_invalid_symbol=true)
eurusd1= request.security("EURUSD", "D",close[1], ignore_invalid_symbol=true)
btcusd= request.security("BTCUSD","D",close, ignore_invalid_symbol=true)
btcusd1= request.security("BTCUSD","D",close[1], ignore_invalid_symbol=true)
xauusd= request.security("XAUUSD1!","D",close, ignore_invalid_symbol=true)
xauusd1= request.security("XAUUSD1!","D",close[1], ignore_invalid_symbol=true)
xagusd= request.security("XAGUSD1!","D",close, ignore_invalid_symbol=true)
xagusd1= request.security("XAGUSD1!","D",close[1], ignore_invalid_symbol=true)
us10y= request.security("US10Y","D",close, ignore_invalid_symbol=true)
us10y1= request.security("US10Y","D",close[1], ignore_invalid_symbol=true)
brent= request.security("BR1!","D",close, ignore_invalid_symbol=true)
brent1= request.security("BR1!","D",close[1], ignore_invalid_symbol=true)
dgaz= request.security("NG1!","D",close, ignore_invalid_symbol=true)
dgaz1= request.security("NG1!","D",close[1], ignore_invalid_symbol=true)
hrc= request.security("HRC1!","D",close, ignore_invalid_symbol=true)
hrc1= request.security("HRC1!","D",close[1], ignore_invalid_symbol=true)
dxy= request.security("DXY","D",close, ignore_invalid_symbol=true)
dxy1= request.security("DXY","D",close[1], ignore_invalid_symbol=true)
bugday= request.security("ZW1!","D",close, ignore_invalid_symbol=true)
bugday1= request.security("ZW1!","D",close[1], ignore_invalid_symbol=true)
bakir= request.security("HG1!","D",close, ignore_invalid_symbol=true)
bakir1= request.security("HG1!","D",close[1], ignore_invalid_symbol=true)
komur= request.security("DJUSCL","D",close, ignore_invalid_symbol=true)
komur1= request.security("DJUSCL","D",close[1], ignore_invalid_symbol=true)
b100= request.security("XU100","D",close, ignore_invalid_symbol=true)
b1001= request.security("XU100","D",close[1], ignore_invalid_symbol=true)
b30= request.security("XU030","D",close, ignore_invalid_symbol=true)
b301= request.security("XU030","D",close[1], ignore_invalid_symbol=true)
vip30= request.security("XU030D1!","D",close, ignore_invalid_symbol=true)
vip301= request.security("XU030D1!","D",close[1], ignore_invalid_symbol=true)

//PANEL FEATURES
/////////////////////////////////////////////
f_draw_infopanel(_x, _y, _line, _text, _color)=>
    _rep_text = ""
    for _l = 0 to _line
        _rep_text := _rep_text + "\n"
    _rep_text := _rep_text + _text
    var label _la = na
    label.delete(_la)
    _la := label.new(style =  label.style_label_up,x=_x, y=_y, 
         text=_rep_text, xloc=xloc.bar_time, yloc=yloc.price, 
         color=color.yellow, textcolor=_color, size=size.normal)

//PANEL LOCATION
/////////////////////////////////////////////
PanelLocation = input(50, title="Panel Lokasyon Ayar")
//Recommended Settings for 4Hour (50)

//PANEL LOCATION
/////////////////////////////////////////////
posx = timenow + math.round(ta.change(time)*PanelLocation)
posy = ta.highest(50)

//PANEL PARTS
/////////////////////////////////////////////
f_draw_infopanel(posx, posy, 34, "BUĞDAY: "+str.tostring(bugday)+"   "+ "%" +str.tostring(math.round((bugday-bugday1)/bugday*100,2)),  (bugday-bugday1)/bugday*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 32, "KÖMÜR: "+str.tostring(komur)+"   "+ "%" +str.tostring(math.round((komur-komur1)/komur*100,2)), (komur-komur1)/komur*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 30, "BAKIR: "+str.tostring(bakir)+"   "+ "%" +str.tostring(math.round((bakir-bakir1)/hrc*100,2)), (bakir-bakir1)/bakir*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 28, "HRC: "+str.tostring(hrc)+"   "+ "%" +str.tostring(math.round((hrc-hrc1)/hrc*100,2)), (hrc-hrc1)/hrc*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 26, "DOĞAL GAZ: "+str.tostring(dgaz)+"   "+ "%" +str.tostring(math.round((dgaz-dgaz1)/dgaz*100,2)), (dgaz-dgaz1)/dgaz*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 24, "BRENT: "+str.tostring(brent)+"   "+ "%" +str.tostring(math.round((brent-brent1)/brent*100,2)), (brent-brent1)/brent*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 22, "US10Y: "+str.tostring(us10y)+"   "+ "%" +str.tostring(math.round((us10y-us10y1)/us10y*100,2)), (us10y-us10y1)/us10y*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 20, "XAGUSD: "+str.tostring(xagusd)+"   "+ "%" +str.tostring(math.round((xagusd-xagusd1)/xagusd*100,2)), (xagusd-xagusd1)/xagusd*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 18, "XAUUSD: "+str.tostring(xauusd)+"   "+ "%" +str.tostring(math.round((xauusd-xauusd1)/xauusd*100,2)), (xauusd-xauusd1)/xauusd*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 16, "BTCUSD: "+str.tostring(btcusd)+"   "+ "%" +str.tostring(math.round((btcusd-btcusd1)/btcusd*100,2)), (btcusd-btcusd1)/btcusd*100 > 0 ?color.green : color.red)
f_draw_infopanel(posx, posy, 14, "EURUSD: "+str.tostring(eurusd)+"   "+ "%" +str.tostring(math.round((eurusd-eurusd1)/eurusd*100,2)), (eurusd-eurusd1)/eurusd*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 12, "VIX: "+str.tostring(vix)+"   "+ "%" +str.tostring(math.round((vix-vix1)/vix*100,2)), (vix-vix1)/vix*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 10, "DXY: "+str.tostring(dxy)+"   "+ "%" +str.tostring(math.round((dxy-dxy1)/dxy*100,2)), (dxy-dxy1)/dxy*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 8, "DAX: "+str.tostring(dax)+"   "+ "%" +str.tostring(math.round((dax-dax1)/dax*100,2)), (dax-dax1)/dax*100 > 0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 6, "DJI: "+str.tostring(dow)+"   "+ "%" +str.tostring(math.round((dow-dow1)/dow*100,2)), (dow-dow1)/dow*100 >0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 4, "VİP-30: "+str.tostring(math.round(vip30,2))+"   "+ "%" +str.tostring(math.round((vip30-vip301)/vip30*100,2)), (vip30-vip301)/vip30*100 >0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 2, "BİST-30: "+str.tostring(math.round(b30,2))+"   "+ "%" +str.tostring(math.round((b30-b301)/b30*100,2)), (b30-b301)/b30*100 >0 ? color.green : color.red)
f_draw_infopanel(posx, posy, 0, "BİST-100: "+str.tostring(math.round(b100,2))+"   "+ "%" +str.tostring(math.round((b100-b1001)/b100*100,2)), (b100-b1001)/b100*100 >0 ? color.green : color.red)

