Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- indicator('Tabla DOLAR CCL', shorttitle='Tabla Dolar CCL - Peronia (C) FG ', overlay=true,linktoseries=true)
- bgcol = #1e1e1f
- textcol = #83aa98
- textcol2 = #a890d0
- dolar_ccl_0 = request.security('BCBA:AAPL', 'D', close) / request.security('NASDAQ:AAPL', 'D', close) * 10
- dolar_ccl_0a = request.security('BCBA:AAPL', 'D', close[1]) / request.security('NASDAQ:AAPL', 'D', close[1]) * 10
- c0=100-(dolar_ccl_0a * 100/ dolar_ccl_0)
- c0c=c0 > 0 ? #519f56 : #d58183
- dolar_ccl_1 = request.security('BCBA:TSLA', 'D', close) / request.security('NASDAQ:TSLA', 'D', close) * 15
- dolar_ccl_1a = request.security('BCBA:TSLA', 'D', close[1]) / request.security('NASDAQ:TSLA', 'D', close[1]) * 15
- c1=100-(dolar_ccl_1a * 100/ dolar_ccl_1)
- c1c=c1 > 0 ? #519f56 : #d58183
- dolar_ccl_2 = request.security('BCBA:KO', 'D', close) / request.security('NYSE:KO', 'D', close) * 5
- dolar_ccl_2a = request.security('BCBA:KO', 'D', close[1]) / request.security('NYSE:KO', 'D', close[1]) * 5
- c2=100-(dolar_ccl_2a * 100/ dolar_ccl_2)
- c2c=c2 > 0 ? #519f56 : #d58183
- dolar_ccl_3 = request.security('BCBA:GOLD', 'D', close) / request.security('NYSE:GOLD', 'D', close) * 1
- dolar_ccl_3a = request.security('BCBA:GOLD', 'D', close[1]) / request.security('NYSE:GOLD', 'D', close[1]) * 1
- c3=100-(dolar_ccl_3a * 100/ dolar_ccl_3)
- c3c=c3 > 0 ? #519f56 : #d58183
- dolar_ccl_4 = request.security('BCBA:AMZN', 'D', close) / request.security('NASDAQ:AMZN', 'D', close) * 144
- dolar_ccl_4a = request.security('BCBA:AMZN', 'D', close[1]) / request.security('NASDAQ:AMZN', 'D', close[1]) * 144
- c4=100-(dolar_ccl_4a * 100/ dolar_ccl_4)
- c4c=c4 > 0 ? #519f56 : #d58183
- dolar_ccl_5 = request.security('BCBA:BRKB', 'D', close) / request.security("NYSE:BRK.B", 'D', close) * 22
- dolar_ccl_5a = request.security('BCBA:BRKB', 'D', close[1]) / request.security("NYSE:BRK.B", 'D', close[1]) * 22
- c5=100-(dolar_ccl_5a * 100/ dolar_ccl_5)
- c5c=c5 > 0 ? #519f56 : #d58183
- dolar_ccl_6 = request.security('BCBA:YPFD', 'D', close) / request.security("NYSE:YPF", 'D', close) * 1
- dolar_ccl_6a = request.security('BCBA:YPFD', 'D', close[1]) / request.security("NYSE:YPF", 'D', close[1]) * 1
- c6=100-(dolar_ccl_6a * 100/ dolar_ccl_6)
- c6c=c6 > 0 ? #519f56 : #d58183
- dolar_ccl_7 = request.security('BCBA:GGAL', 'D', close) / request.security("NASDAQ:GGAL", 'D', close) * 10
- dolar_ccl_7a = request.security('BCBA:GGAL', 'D', close[1]) / request.security("NASDAQ:GGAL", 'D', close[1]) * 10
- c7=100-(dolar_ccl_7a * 100/ dolar_ccl_7)
- c7c=c7 > 0 ? #519f56 : #d58183
- dolar_ccl_8 = request.security('BCBA:LLY', 'D', close) / request.security("NYSE:LLY", 'D', close) * 8
- dolar_ccl_8a = request.security('BCBA:LLY', 'D', close[1]) / request.security("NYSE:LLY", 'D', close[1]) * 8
- c8=100-(dolar_ccl_8a * 100/ dolar_ccl_8)
- c8c=c8 > 0 ? #519f56 : #d58183
- dolar_ccl_9 = request.security('BCBA:GRMN', 'D', close) / request.security("NYSE:GRMN", 'D', close) * 3
- dolar_ccl_9a = request.security('BCBA:GRMN', 'D', close[1]) / request.security("NYSE:GRMN", 'D', close[1]) * 3
- c9=100-(dolar_ccl_9a * 100/ dolar_ccl_9)
- c9c=98 > 0 ? #519f56 : #d58183
- table_color=#053012
- tableData = table.new(position = position.bottom_right, columns = 4, rows = 11,border_width = 2,border_color =table_color, frame_color =table_color)
- table.cell(tableData, 1, 0, 'CCL', text_color=color.green, bgcolor=bgcol)
- table.cell(tableData, 2, 0, 'CH24', text_color=color.green, bgcolor=bgcol)
- table.cell(tableData, 0, 1, 'AAPL', text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 1, 1, str.tostring(dolar_ccl_0,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 1, str.tostring(c0,"#0.00")+"%", text_color=c0c, bgcolor=bgcol)
- table.cell(tableData, 0, 2, 'TSLA', text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 1, 2, str.tostring(dolar_ccl_1,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 2, str.tostring(c1,"#0.00")+"%", text_color=c1c, bgcolor=bgcol)
- table.cell(tableData, 0, 3, 'KO', text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 1, 3, str.tostring(dolar_ccl_2,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 3, str.tostring(c2,"#0.00")+"%", text_color=c2c, bgcolor=bgcol)
- table.cell(tableData, 0, 4, 'GOLD', text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 1, 4, str.tostring(dolar_ccl_3,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 4, str.tostring(c3,"#0.00")+"%", text_color=c3c, bgcolor=bgcol)
- table.cell(tableData, 0, 5, 'AMZN', text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 1, 5, str.tostring(dolar_ccl_4,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 5, str.tostring(c4,"#0.00")+"%", text_color=c4c, bgcolor=bgcol)
- table.cell(tableData, 0, 6, "BRK.B", text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 1, 6, str.tostring(dolar_ccl_5,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 6, str.tostring(c5,"#0.00")+"%", text_color=c5c, bgcolor=bgcol)
- table.cell(tableData, 0, 7, "YPF", text_color=textcol2, bgcolor=bgcol)
- table.cell(tableData, 1, 7, str.tostring(dolar_ccl_6,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 7, str.tostring(c6,"#0.00")+"%", text_color=c6c, bgcolor=bgcol)
- table.cell(tableData, 0, 8, "GGAL", text_color=textcol2, bgcolor=bgcol)
- table.cell(tableData, 1, 8, str.tostring(dolar_ccl_7,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 8, str.tostring(c7,"#0.00")+"%", text_color=c7c, bgcolor=bgcol)
- table.cell(tableData, 0, 9, "LLY", text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 1, 9, str.tostring(dolar_ccl_8,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 9, str.tostring(c8,"#0.00")+"%", text_color=c8c, bgcolor=bgcol)
- table.cell(tableData, 0, 10, "GRMN", text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 1, 10, str.tostring(dolar_ccl_9,"#,###.00"), text_color=textcol, bgcolor=bgcol)
- table.cell(tableData, 2, 10, str.tostring(c8,"#0.00")+"%", text_color=c8c, bgcolor=bgcol)
- // SMA
- len = input.int(9, minval=1, title="Length")
- src = input(close, title="Source")
- offset = input.int(title="Offset", defval=0, minval=-500, maxval=500)
- out = ta.sma(src, len)
- plot(out, color=color.blue, title="MA", offset=offset)
- ma(source, length, type) =>
- switch type
- "SMA" => ta.sma(source, length)
- "EMA" => ta.ema(source, length)
- "SMMA (RMA)" => ta.rma(source, length)
- "WMA" => ta.wma(source, length)
- "VWMA" => ta.vwma(source, length)
- typeMA = input.string(title = "Method", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="Smoothing")
- smoothingLength = input.int(title = "Length", defval = 5, minval = 1, maxval = 100, group="Smoothing")
- smoothingLine = ma(out, smoothingLength, typeMA)
- plot(smoothingLine, title="Smoothing Line", color=#f37f20, offset=offset, display=display.none)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement