Listado CCL - price of the dollar in Argentina
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//@version=4

study("Listado CCL", overlay=true)

// Consulto los precios de close de diferentes Tickers basados en la fórmula de CCL
bmaClose = security("BCBA:BMA*10/NYSE:BMA", timeframe.period, close)
cepuClose = security("BCBA:CEPU*10/NYSE:CEPU", timeframe.period, close)
ggalClose = security("BCBA:GGAL*10/NASDAQ:GGAL", timeframe.period, close)
lomaClose = security("BCBA:LOMA*5/NYSE:LOMA", timeframe.period, close)
pamClose = security("BCBA:PAMP*25/NYSE:PAM", timeframe.period, close)
supvClose = security("BCBA:SUPV*5/NYSE:SUPV", timeframe.period, close)
tgsClose = security("BCBA:TGSU2*5/NYSE:TGS", timeframe.period, close)
ypfClose = security("BCBA:YPFD/NYSE:YPF", timeframe.period, close) 


// Imprimo solo en la ultima barra
if(barstate.islast)
    l = label.new(bar_index, na, 
      'Listado Cotizaciones CCL:\n\n'
      +'BMA: '+tostring(bmaClose,'#.#')
      +'\nCEPU: '+tostring(cepuClose,'#.#')
      +'\nGGAL: '+tostring(ggalClose,'#.#')
      +'\nLOMA: '+tostring(lomaClose,'#.#')
      +'\nPAMPA: '+tostring(pamClose,'#.#')
      +'\nSUPV: '+tostring(supvClose,'#.#')      
      +'\nTGS: '+tostring(tgsClose,'#.#')      
      +'\nYPF: '+tostring(ypfClose,'#.##'),

      color=color.white, 
      textcolor=color.gray,
      style=label.style_label_left, 
      yloc=yloc.belowbar,
      size=size.normal,
      textalign=text.align_left)  