Advertisement
fagervan

dolar-ccl-peronia

Oct 27th, 2023 (edited)
1,179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
KiXtart 6.87 KB | Cryptocurrency | 0 0
  1. //@version=5
  2. indicator('Tabla DOLAR CCL', shorttitle='Tabla Dolar CCL - Peronia (C) FG ', overlay=true,linktoseries=true)
  3.  
  4. bgcol = #1e1e1f
  5. textcol = #83aa98
  6. textcol2 = #a890d0
  7.  
  8. dolar_ccl_0 = request.security('BCBA:AAPL', 'D', close) / request.security('NASDAQ:AAPL', 'D', close) * 10
  9. dolar_ccl_0a = request.security('BCBA:AAPL', 'D', close[1]) / request.security('NASDAQ:AAPL', 'D', close[1]) * 10
  10. c0=100-(dolar_ccl_0a * 100/ dolar_ccl_0)
  11. c0c=c0  > 0 ? #519f56 :  #d58183
  12.  
  13. dolar_ccl_1 = request.security('BCBA:TSLA', 'D', close) / request.security('NASDAQ:TSLA', 'D', close) * 15
  14. dolar_ccl_1a = request.security('BCBA:TSLA', 'D', close[1]) / request.security('NASDAQ:TSLA', 'D', close[1]) * 15
  15. c1=100-(dolar_ccl_1a * 100/ dolar_ccl_1)
  16. c1c=c1  > 0 ? #519f56 :  #d58183
  17.  
  18. dolar_ccl_2 = request.security('BCBA:KO', 'D', close) / request.security('NYSE:KO', 'D', close) * 5
  19. dolar_ccl_2a = request.security('BCBA:KO', 'D', close[1]) / request.security('NYSE:KO', 'D', close[1]) * 5
  20. c2=100-(dolar_ccl_2a * 100/ dolar_ccl_2)
  21. c2c=c2  > 0 ? #519f56 :  #d58183
  22.  
  23. dolar_ccl_3 = request.security('BCBA:GOLD', 'D', close) / request.security('NYSE:GOLD', 'D', close) * 1
  24. dolar_ccl_3a = request.security('BCBA:GOLD', 'D', close[1]) / request.security('NYSE:GOLD', 'D', close[1]) * 1
  25. c3=100-(dolar_ccl_3a * 100/ dolar_ccl_3)
  26. c3c=c3  > 0 ? #519f56 :  #d58183
  27.  
  28. dolar_ccl_4 = request.security('BCBA:AMZN', 'D', close) / request.security('NASDAQ:AMZN', 'D', close) * 144
  29. dolar_ccl_4a = request.security('BCBA:AMZN', 'D', close[1]) / request.security('NASDAQ:AMZN', 'D', close[1]) * 144
  30. c4=100-(dolar_ccl_4a * 100/ dolar_ccl_4)
  31. c4c=c4  > 0 ? #519f56 :  #d58183
  32.  
  33. dolar_ccl_5 = request.security('BCBA:BRKB', 'D', close) / request.security("NYSE:BRK.B", 'D', close) * 22
  34. dolar_ccl_5a = request.security('BCBA:BRKB', 'D', close[1]) / request.security("NYSE:BRK.B", 'D', close[1]) * 22
  35. c5=100-(dolar_ccl_5a * 100/ dolar_ccl_5)
  36. c5c=c5  > 0 ? #519f56 :  #d58183
  37.  
  38. dolar_ccl_6 = request.security('BCBA:YPFD', 'D', close) / request.security("NYSE:YPF", 'D', close) * 1
  39. dolar_ccl_6a = request.security('BCBA:YPFD', 'D', close[1]) / request.security("NYSE:YPF", 'D', close[1]) * 1
  40. c6=100-(dolar_ccl_6a * 100/ dolar_ccl_6)
  41. c6c=c6  > 0 ? #519f56 :  #d58183
  42.  
  43. dolar_ccl_7 = request.security('BCBA:GGAL', 'D', close) / request.security("NASDAQ:GGAL", 'D', close) * 10
  44. dolar_ccl_7a = request.security('BCBA:GGAL', 'D', close[1]) / request.security("NASDAQ:GGAL", 'D', close[1]) * 10
  45. c7=100-(dolar_ccl_7a * 100/ dolar_ccl_7)
  46. c7c=c7  > 0 ? #519f56 :  #d58183
  47.  
  48. dolar_ccl_8 = request.security('BCBA:LLY', 'D', close) / request.security("NYSE:LLY", 'D', close) * 8
  49. dolar_ccl_8a = request.security('BCBA:LLY', 'D', close[1]) / request.security("NYSE:LLY", 'D', close[1]) * 8
  50. c8=100-(dolar_ccl_8a * 100/ dolar_ccl_8)
  51. c8c=c8  > 0 ? #519f56 :  #d58183
  52.  
  53. dolar_ccl_9 = request.security('BCBA:GRMN', 'D', close) / request.security("NYSE:GRMN", 'D', close) * 3
  54. dolar_ccl_9a = request.security('BCBA:GRMN', 'D', close[1]) / request.security("NYSE:GRMN", 'D', close[1]) * 3
  55. c9=100-(dolar_ccl_9a * 100/ dolar_ccl_9)
  56. c9c=98  > 0 ? #519f56 :  #d58183
  57.  
  58.  
  59. table_color=#053012
  60. tableData = table.new(position = position.bottom_right, columns = 4, rows = 11,border_width = 2,border_color =table_color, frame_color =table_color)
  61.  
  62. table.cell(tableData, 1, 0, 'CCL', text_color=color.green, bgcolor=bgcol)
  63. table.cell(tableData, 2, 0, 'CH24', text_color=color.green, bgcolor=bgcol)
  64.  
  65. table.cell(tableData, 0, 1, 'AAPL', text_color=textcol, bgcolor=bgcol)
  66. table.cell(tableData, 1, 1, str.tostring(dolar_ccl_0,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  67. table.cell(tableData, 2, 1, str.tostring(c0,"#0.00")+"%", text_color=c0c, bgcolor=bgcol)
  68.  
  69. table.cell(tableData, 0, 2, 'TSLA', text_color=textcol, bgcolor=bgcol)
  70. table.cell(tableData, 1, 2, str.tostring(dolar_ccl_1,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  71. table.cell(tableData, 2, 2, str.tostring(c1,"#0.00")+"%", text_color=c1c, bgcolor=bgcol)
  72.  
  73. table.cell(tableData, 0, 3, 'KO', text_color=textcol, bgcolor=bgcol)
  74. table.cell(tableData, 1, 3, str.tostring(dolar_ccl_2,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  75. table.cell(tableData, 2, 3, str.tostring(c2,"#0.00")+"%", text_color=c2c, bgcolor=bgcol)
  76.  
  77. table.cell(tableData, 0, 4, 'GOLD', text_color=textcol, bgcolor=bgcol)
  78. table.cell(tableData, 1, 4, str.tostring(dolar_ccl_3,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  79. table.cell(tableData, 2, 4, str.tostring(c3,"#0.00")+"%", text_color=c3c, bgcolor=bgcol)
  80.  
  81. table.cell(tableData, 0, 5, 'AMZN', text_color=textcol, bgcolor=bgcol)
  82. table.cell(tableData, 1, 5, str.tostring(dolar_ccl_4,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  83. table.cell(tableData, 2, 5, str.tostring(c4,"#0.00")+"%", text_color=c4c, bgcolor=bgcol)
  84.  
  85. table.cell(tableData, 0, 6, "BRK.B", text_color=textcol, bgcolor=bgcol)
  86. table.cell(tableData, 1, 6, str.tostring(dolar_ccl_5,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  87. table.cell(tableData, 2, 6, str.tostring(c5,"#0.00")+"%", text_color=c5c, bgcolor=bgcol)
  88.  
  89. table.cell(tableData, 0, 7, "YPF", text_color=textcol2, bgcolor=bgcol)
  90. table.cell(tableData, 1, 7, str.tostring(dolar_ccl_6,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  91. table.cell(tableData, 2, 7, str.tostring(c6,"#0.00")+"%", text_color=c6c, bgcolor=bgcol)
  92.  
  93.  
  94. table.cell(tableData, 0, 8, "GGAL", text_color=textcol2, bgcolor=bgcol)
  95. table.cell(tableData, 1, 8, str.tostring(dolar_ccl_7,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  96. table.cell(tableData, 2, 8, str.tostring(c7,"#0.00")+"%", text_color=c7c, bgcolor=bgcol)
  97.  
  98. table.cell(tableData, 0, 9, "LLY", text_color=textcol, bgcolor=bgcol)
  99. table.cell(tableData, 1, 9, str.tostring(dolar_ccl_8,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  100. table.cell(tableData, 2, 9, str.tostring(c8,"#0.00")+"%", text_color=c8c, bgcolor=bgcol)
  101.  
  102. table.cell(tableData, 0, 10, "GRMN", text_color=textcol, bgcolor=bgcol)
  103. table.cell(tableData, 1, 10, str.tostring(dolar_ccl_9,"#,###.00"), text_color=textcol, bgcolor=bgcol)
  104. table.cell(tableData, 2, 10, str.tostring(c8,"#0.00")+"%", text_color=c8c, bgcolor=bgcol)
  105.  
  106.  
  107.  
  108. // SMA
  109.  
  110.  
  111. len = input.int(9, minval=1, title="Length")
  112. src = input(close, title="Source")
  113. offset = input.int(title="Offset", defval=0, minval=-500, maxval=500)
  114. out = ta.sma(src, len)
  115. plot(out, color=color.blue, title="MA", offset=offset)
  116.  
  117. ma(source, length, type) =>
  118.     switch type
  119.         "SMA" => ta.sma(source, length)
  120.         "EMA" => ta.ema(source, length)
  121.         "SMMA (RMA)" => ta.rma(source, length)
  122.         "WMA" => ta.wma(source, length)
  123.         "VWMA" => ta.vwma(source, length)
  124.  
  125. typeMA = input.string(title = "Method", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="Smoothing")
  126. smoothingLength = input.int(title = "Length", defval = 5, minval = 1, maxval = 100, group="Smoothing")
  127.  
  128. smoothingLine = ma(out, smoothingLength, typeMA)
  129. plot(smoothingLine, title="Smoothing Line", color=#f37f20, offset=offset, display=display.none)
  130.  
Tags: trading view
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement