//@version=5 indicator("INDICADORES DOC 4IN1 V1.4.3", shorttitle="INDICADORES DOC 4IN1 V1.4.3", overlay=true) /////////GENIAL LINE mostrarGenial = input(true, title='Mostrar genial line') src = input(close) genial = input(34, title='GENIAL LINE') pgenial = ta.sma(src, genial) genialplot = plot(mostrarGenial ? pgenial : na, color=color.black, style=plot.style_cross, join=false, linewidth=2, title='GENIAL LINE') /////////FIN GENIAL LINE //////ZONA DE CORRECION ema8 = ta.ema(src, input(8,title='EMA-8')) // /////WILDER 8 f_wwma(l, p) => wwma = 0. wwma := (nz(wwma[1]) * (l - 1) + p) / l wilder8 = f_wwma(8, close) // ///// FIN WILDER 8 fill_color = ema8> wilder8 ? color.new(color.green,75) : color.new(color.red,75) plotema8 = plot(ema8,color=fill_color, linewidth=2,title='EMA 8 ZONA CORRECCION') plotwilder8 = plot(wilder8,color=color.rgb(133, 56, 5), linewidth=2,style=plot.style_circles,title='Wilder 8 ZONA CORRECCION') // ////// Colorear el fondo entre las EMAs fill(plotema8,plotwilder8,color=fill_color,title ='ZONA DE CORRECCION',editable = true) ///////FIN ZONA DE CORRECION /////TUNEL DOMENEC ema123 = input(123,title='EMA-123') ema188 = input(188,title='EMA-188') ema416 = input(416,title='EMA-416') ema618 = input(618,title='EMA-618') ema882 = input(882,title='EMA-882') ema1223 = input(1223,title='EMA-1223') pema123 = ta.ema(src, ema123) pema188 = ta.ema(src, ema188) pema416 = ta.ema(src, ema416) pema618 = ta.ema(src, ema618) pema882 = ta.ema(src, ema882) pema1223 = ta.ema(src, ema1223) cinta1 = plot(pema123,title='EMA-123 TUNEL 1',color=color.blue, linewidth=1,editable = true) cinta1_1 = plot(pema188,title='EMA 188 TUNEL 1',color=color.blue, linewidth=1,editable = true) cinta2 = plot(pema416,title='EMA-416 TUNEL 2',color=color.yellow, linewidth=1,editable = true) cinta2_1 = plot(pema618,title='EMA 618 TUNEL 2',color=color.yellow, linewidth=1,editable = true) cinta3 = plot(pema882,title='EMA-882 TUNEL 3', color=#FF1493, linewidth=1,editable = true) cinta3_1 = plot(pema1223,title='EMA 1223 TUNEL 3', color=#FF1493, linewidth=1,editable = true) fill(cinta1,cinta1_1,color.new(color.blue,transp = 75),title='COLOR TUNEL 1', editable=true) fill(cinta2,cinta2_1,color.new(color.yellow,transp=75),title='COLOR TUNEL 2', editable=true) fill(cinta3,cinta3_1,color.new(color=#FF1493, transp=75),title='COLOR TUNEL 3', editable=true) //////FIN TUNEL DOMENEC //////MULTICOTAS import PineCoders/VisibleChart/4 as vc //// Personalización // Tipos de cota _mostrarCotasHistoricas = input(true, 'Mostrar cotas históricas', group = 'Tipos de cota') // Personalización general para cotas históricas intrumentoParametrizado = input('AUTO', 'Nombre del instrumento para el que se quieren representar las cotas. Los valores admitidos son: AUTO, DAX, NQ, XAU, DOW, WTI, IBEX, EUR, Btc, Jpy, HangSeng, FTSE, Gpb, ASX, PXI, Nikkei.', group = 'Personalización general de cotas históricas') porcentajeVisualizacionSobreRangoVisible = input(300, "Valor porcentual respecto al rango de pips visible en el gráfico para el cuál se van a mostrar las cotas históricas", group = 'Personalización general de cotas históricas') mostrarTodas = input(false, "Valor binario que determina si se muestran todas las cotas históricas. En caso contrario se muestran solo las que estén en un intervalo determinado", group = 'Personalización general de cotas históricas') // Nombres de simbolos asociados a las cotas históricas mostrarNombreTickerActual = input(false, 'Valor binario que determina si se muestra una etiqueta con el nombre del ticker del instrumento actual', group = 'Nombres de tickers de cotas históricas') DAX = input('DAX,GRXEUR,DE40,GER30,GER40,DE30EUR', 'Lista de tikers asociados al DAX', group = 'Nombres de tickers de cotas históricas') NQ = input('NQ,NASDAQ,US100,NAS100,NAS100USD', 'Lista de tikers asociados al NQ', group = 'Nombres de tickers de cotas históricas') DOW = input('DOW,DJ30,US30', 'Lista de tikers asociados al DOW', group = 'Nombres de tickers de cotas históricas') IBEX = input('IBEX,IBEX35', 'Lista de tikers asociados al IBEX', group = 'Nombres de tickers de cotas históricas') FTSE = input('FTSE', 'Lista de tikers asociados al FTSE', group = 'Nombres de tickers de cotas históricas') HangSeng = input('HangSeng', 'Lista de tikers asociados al HangSeng', group = 'Nombres de tickers de cotas históricas') Nikkei = input('Nikkei,NI225', 'Lista de tikers asociados al Nikkei', group = 'Nombres de tickers de cotas históricas') PXI = input('PXI,CAC40', 'Lista de tikers asociados al PXI', group = 'Nombres de tickers de cotas históricas') ASX = input('ASX,AU200AUD', 'Lista de tikers asociados al ASX', group = 'Nombres de tickers de cotas históricas') XAU = input('XAU,GOLD,XAUUSD', 'Lista de tikers asociados al ORO', group = 'Nombres de tickers de cotas históricas') WTI = input('WTI,USOIL', 'Lista de tikers asociados al WTI', group = 'Nombres de tickers de cotas históricas') EUR = input('EUR,EURUSD', 'Lista de tikers asociados al EUR', group = 'Nombres de tickers de cotas históricas') Jpy = input('Jpy,USDJPY', 'Lista de tikers asociados al Jpy', group = 'Nombres de tickers de cotas históricas') Gpb = input('Gpb,GBPUSD', 'Lista de tikers asociados al Gpb', group = 'Nombres de tickers de cotas históricas') Btc = input('Btc,BTCUSDT', 'Lista de tikers asociados al Btc', group = 'Nombres de tickers de cotas históricas') grosorCotas = input(4, "Valor numérico que determina el grosor de toda cota histórica", group = 'Estilo de cotas históricas') amarillo = input(color.yellow, "Color para la cota de apertura anual", group = 'Estilo de cotas históricas') azulMarino = input(color.blue, "Color para las cotas trimestrales", group = 'Estilo de cotas históricas') azulClaro = input(color.aqua, "Color para las cotas semanales", group = 'Estilo de cotas históricas') azulOscuro = input(color.navy, "Color para las cotas psicológicas", group = 'Estilo de cotas históricas') rojo = input(color.red, "Color para las cotas diarias", group = 'Estilo de cotas históricas') verdeOscruo = input(color.green, "Color para las cotas diarias", group = 'Estilo de cotas históricas') desplazamientoLateralEtiqueta = input(5, 'Número de barras que se desplaza la etiquta lateralmente respecto a la última barra del gráfico', group = 'Estilo de cotas históricas') ColorEtiquetas = input(color.black, "Color para el texto de las etiquetas", group = 'Estilo de cotas históricas') // Personalización de cotas diarias zonaHoraria = input("GMT+02", "Permite ajustar el valor devuelto a una zona horaria especificada en notación UTC/GMT (por ejemplo, 'UTC-5', 'GMT+0530') o como un nombre de la base de datos de zona horaria de IANA (por ejemplo, 'America/New_York').", group = 'Personalización general de cotas diarias') hora_apertura = input(0, "Valor textual que representa la hora de apertura del mercado en el instrumento", group = 'Personalización general de cotas diarias') minutos_apertura = input(0, "Valor textual que representa los minutos de apertura del mercado en el instrumento", group = 'Personalización general de cotas diarias') mostrar_momento_apertura = input(false, "Valor binario que determina si se muestra una etiqueta con la hora de apertura calculada en base a la configuración") //// Fin de Personalización //// Variables globales (aplican a toda barra) var float[] trimestrales = array.new_float() var float[] semanal = array.new_float() var float[] psicologicas = array.new_float() var float[] diarias = array.new_float() var float[] cortoPlazo = array.new_float() var float aperturaAnual = na var string intrumento = na precioMaximoVisible = vc.high() precioMinimoVisible = vc.low() numeroPuntosVisibles = (precioMaximoVisible-precioMinimoVisible) limiteSuperior = close + numeroPuntosVisibles * porcentajeVisualizacionSobreRangoVisible/100 limiteInferior = close - numeroPuntosVisibles * porcentajeVisualizacionSobreRangoVisible/100 //// Definición de funciones f_label_derecha(float cota, string inicialTipoCota) => label.new(bar_index+desplazamientoLateralEtiqueta, cota, str.format("{0} ({1})",str.tostring(math.round(cota)), inicialTipoCota), style=label.style_none, textcolor=ColorEtiquetas, textalign = text.align_left) f_label_izquierda(float cota, string inicialTipoCota) => label.new(bar_index-(desplazamientoLateralEtiqueta), cota, str.format("{0} ({1})",str.tostring(math.round(cota)), inicialTipoCota), style=label.style_none, textcolor=ColorEtiquetas, textalign = text.align_left) f_cotaHistorica(float cota, color _color) => line.new(bar_index, cota, bar_index+1, cota, extend=extend.both, style=line.style_solid,color=_color, width=grosorCotas) f_cotaDiaria(float coeficienteMultiplicador, string estilo, color color, int ancho) => line.new(bar_index, open*coeficienteMultiplicador, bar_index+1, open*coeficienteMultiplicador, extend=extend.right, style=estilo, color=color, width=ancho) //// Lógica para cotas históricas // Enter data into the arrays on the first bar only. // No need to do it on every bar (for performance). if barstate.isfirst // selección del instrumento a acotar if(intrumentoParametrizado=='AUTO') arr = str.split(DAX,',') if(arr.includes(syminfo.ticker)) intrumento := 'DAX' arr := str.split(XAU,',') if(arr.includes(syminfo.ticker)) intrumento := 'XAU' arr := str.split(NQ,',') if(arr.includes(syminfo.ticker)) intrumento := 'NQ' arr := str.split(DOW,',') if(arr.includes(syminfo.ticker)) intrumento := 'DOW' arr := str.split(WTI,',') if(arr.includes(syminfo.ticker)) intrumento := 'WTI' arr := str.split(IBEX,',') if(arr.includes(syminfo.ticker)) intrumento := 'IBEX' arr := str.split(EUR,',') if(arr.includes(syminfo.ticker)) intrumento := 'EUR' arr := str.split(Btc,',') if(arr.includes(syminfo.ticker)) intrumento := 'Btc' arr := str.split(Jpy,',') if(arr.includes(syminfo.ticker)) intrumento := 'Jpy' arr := str.split(HangSeng,',') if(arr.includes(syminfo.ticker)) intrumento := 'HangSeng' arr := str.split(FTSE,',') if(arr.includes(syminfo.ticker)) intrumento := 'FTSE' arr := str.split(Gpb,',') if(arr.includes(syminfo.ticker)) intrumento := 'Gpb' arr := str.split(ASX,',') if(arr.includes(syminfo.ticker)) intrumento := 'ASX' arr := str.split(PXI,',') if(arr.includes(syminfo.ticker)) intrumento := 'PXI' arr := str.split(Nikkei,',') if(arr.includes(syminfo.ticker)) intrumento := 'Nikkei' else intrumento:=intrumentoParametrizado if (intrumento == 'DAX') //A // DAX 13980 // amarilla aperturaAnual := 13980 //T // DAX 2280 3586 5066 6199 8190 9464 11010 12411 13601 16299 // azul marino trimestrales.concat(array.from(2280,3586,5066,6199,8190,9464,11010,12411,13601,16299)) //S // DAX 5410 7080 8690 10111 10779 11433 11704 12881 13601 14100 14814 15550 15980 // azul claro semanal.concat(array.from(5410,7080,8690,10111,10779,11433,11704,12881,13601,14100,14814,15550,15980)) //P // DAX 0.1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000 // azul oscuro psicologicas.concat(array.from(0.1,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,18000,19000,20000)) //D // DAX 950 1052 1204 1312 1398 1522 1608 1710 1808 1940 2096 2472 2680 2896 3068 3240 3434 3710 3840 4036 4182 4420 4566 4730 4924 5262 5657 5886 6096 6320 6552 6764 6888 7262 7432 7628 7794 7886 8092 8462 8791 8900 9122 9280 9611 9716 9811 9915 10037 10314 10476 10597 10844 11163 11342 11608 11779 11876 12042 12193 12236 12578 12830 12921 13037 13153 13262 13494 13870 14420 14560 14678 15113 15300 15465 15624 15744 15864 16090 16155 // rojo diarias.concat(array.from(950,1052,1204,1312,1398,1522,1608,1710,1808,1940,2096,2472,2680,2896,3068,3240,3434,3710,3840,4036,4182,4420,4566,4730,4924,5262,5657,5886,6096,6320,6552,6764,6888,7262,7432,7628,7794,7886,8092,8462,8791,8900,9122,9280,9611,9716,9811,9915,10037,10314,10476,10597,10844,11163,11342,11608,11779,11876,12042,12193,12236,12578,12830,12921,13037,13153,13262,13494,13870,14420,14560,14678,15113,15300,15465,15624,15744,15864,16090,16155)) //C // DAX 5174 5540 5766 6420 6662 6968 7544 7722 8358 8568 8948 9052 9182 9380 9545 9655 9750 9849 9992 10129 10181 10249 10401 10440 10512 10550 10649 10694 10735 10805 10934 11242 11570 11934 12059 12169 12318 12493 12553 12672 12754 13395 14161 15197 15392 15505 15685 15796 15925 // verde oscruro cortoPlazo.concat(array.from(5174,5540,5766,6420,6662,6968,7544,7722,8358,8568,8948,9052,9182,9380,9545,9655,9750,9849,9992,10129,10181,10249,10401,10440,10512,10550,10649,10694,10735,10805,10934,11242,11570,11934,12059,12169,12318,12493,12553,12672,12754,13395,14161,15197,15392,15505,15685,15796,15925)) if (intrumento == 'NQ') //A // NQ 11035 // amarilla aperturaAnual := 11035 //T // NQ 795 2071 2820 3905 4816 5898 7340 9600 10680 12220 13576 15700 16739 // azul marino trimestrales.concat(array.from(795,2071,2820,3905,4816,5898,7340,9600,10680,12220,13576,15700,16739)) //S // NQ 1063 1717 2432 3414 4178 6936 7701 12440 12914 14048 14548 15156 // azul claro semanal.concat(array.from(1063,1717,2432,3414,4178,6936,7701,12440,12914,14048,14548,15156)) //P // NQ 0.1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000 // azul oscuro psicologicas.concat(array.from(0.1,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,18000,19000,20000)) //D // NQ 600 699 938 1142 1288 1370 1478 1630 1898 2226 2626 3054 3258 3514 3714 4094 4326 4554 4692 4882 5146 5356 5558 5786 5996 6256 6460 6700 7180 7512 7950 8228 8424 8862 8908 9248 9384 9748 10108 10308 10432 10960 11070 11260 11570 11810 12034 12670 12792 13186 13340 13482 13710 13864 14142 14264 14442 14728 14910 15046 15266 15498 15964 16178 16418 16630 // rojo diarias.concat(array.from(600,699,938,1142,1288,1370,1478,1630,1898,2226,2626,3054,3258,3514,3714,4094,4326,4554,4692,4882,5146,5356,5558,5786,5996,6256,6460,6700,7180,7512,7950,8228,8424,8862,8908,9248,9384,9748,10108,10308,10432,10960,11070,11260,11570,11810,12034,12670,12792,13186,13340,13482,13710,13864,14142,14264,14442,14728,14910,15046,15266,15498,15964,16178,16418,16630)) //C // NQ 1018 1235 1825 2548 2897 3341 3607 3828 4456 4964 5664 6124 7028 7824 8086 8510 9028 9884 10528 10834 11148 11450 11686 11918 12110 12336 12588 13100 14376 14614 14812 15352 15798 16340 16544 // verde oscruro cortoPlazo.concat(array.from(1018,1235,1825,2548,2897,3341,3607,3828,4456,4964,5664,6124,7028,7824,8086,8510,9028,9884,10528,10834,11148,11450,11686,11918,12110,12336,12588,13100,14376,14614,14812,15352,15798,16340,16544)) if (intrumento == 'XAU') //A // XAUUSD 1827 // amarilla aperturaAnual := 1827 //T // XAUUSD 101 268 507 694 873 988 1160 1363 1526 1790 1918 2076 // azul marino trimestrales.concat(array.from(101,268,507,694,873,988,1160,1363,1526,1790,1918,2076)) //S // XAUUSD 416 1044 1312 1670 1960 // azul claro semanal.concat(array.from(416,1044,1312,1670,1960)) //P // XAUUSD 0.1 500 1000 1500 2000 2500 // azul oscuro psicologicas.concat(array.from(0.1,500,1000,1500,2000,2500)) //D // XAUUSD 40 673 777 831 914 953 1018 1123 1191 1211 1238 1283 1329 1382 1424 1478 1562 1562 1562 1691 1745 1846 1873 1990 // rojo diarias.concat(array.from(40,673,777,831,914,953,1018,1123,1191,1211,1238,1283,1329,1382,1424,1478,1562,1562,1562,1691,1745,1846,1873,1990)) //C // XAUUSD 726 803 854 889 1066 1170 1226 1262 1296 1349 1403 1444 1503 1589 1682 1723 1764 1854 2015 // verde oscruro cortoPlazo.concat(array.from(726,803,854,889,1066,1170,1226,1262,1296,1349,1403,1444,1503,1589,1682,1723,1764,1854,2015)) if (intrumento == 'DOW') //A // DOW 33247 // amarilla aperturaAnual := 33247 //T // DOW 3970 7484 11569 13224 15386 18191 20634 23505 26714 29437 33020 34195 34820 35640 36955 // azul marino trimestrales.concat(array.from(3970,7484,11569,13224,15386,18191,20634,23505,26714,29437,33020,34195,34820,35640,36955)) //S // DOW 6550 10700 14120 17063 19747 21540 25364 27403 31120 // azul claro semanal.concat(array.from(6550,10700,14120,17063,19747,21540,25364,27403,31120)) //P // DOW 0.1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000 21000 22000 23000 24000 25000 26000 27000 28000 29000 30000 31000 32000 33000 34000 35000 36000 37000 38000 39000 40000 // azul oscuro psicologicas.concat(array.from(0.1,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,18000,19000,20000,21000,22000,23000,24000,25000,26000,27000,28000,29000,30000,31000,32000,33000,34000,35000,36000,37000,38000,39000,40000)) //D // DOW 3080 4770 5800 7050 7520 8070 8800 9360 9710 10180 11190 12040 12760 13150 13660 14787 16429 17661 19197 20140 21070 22080 22695 24089 24632 26114 28160 28958 30080 30570 31620 32070 32680 33350 33950 34395 34555 35060 35938 36190 36570 // rojo diarias.concat(array.from(3080,4770,5800,7050,7520,8070,8800,9360,9710,10180,11190,12040,12760,13150,13660,14787,16429,17661,19197,20140,21070,22080,22695,24089,24632,26114,28160,28958,30080,30570,31620,32070,32680,33350,33950,34395,34555,35060,35938,36190,36570)) //C // DOW // verde oscruro //cortoPlazo.concat(DOW)) if (intrumento == 'WTI') //A // WTI 8052 // amarilla aperturaAnual := 80.52 //T // WTI 760 3180 4210 5540 7420 9140 11060 14680 // azul marino trimestrales.concat(array.from(7.60,31.80,42.10,55.40,74.20,91.40,110.60,146.80)) //S // WTI 2115 3675 6210 7820 9964 12820 // azul claro semanal.concat(array.from(2115,3675,6210,7820,9964,12820)) //P // WTI 0.1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000 // azul oscuro psicologicas.concat(array.from(0.1,10.00,20.00,30.00,40.00,50.00,60.00,70.00,80.00,90.00,100.00,110.00,120.00,130.00,140.00,150.00,160.00,170.00,180.00,190.00,200.00)) //D // WTI 1230 1790 2495 2790 3455 3960 4446 4618 4752 4900 5182 5370 5882 6500 6636 6786 7042 7268 7566 7938 8026 8250 8456 8626 8884 9406 9648 9770 10118 10320 10660 10840 11620 12105 13182 13760 // rojo diarias.concat(array.from(12.30,17.90,24.95,27.90,34.55,39.60,44.46,46.18,47.52,49.00,51.82,53.70,58.82,65.00,66.36,67.86,70.42,72.68,75.66,79.38,80.26,82.50,84.56,86.26,88.84,94.06,96.48,97.70,101.18,103.20,106.60,108.40,116.20,121.05,131.82,137.60)) //C // WTI // verde oscruro //cortoPlazo.concat(WTI)) if (intrumento == 'IBEX') //A // IBEX 8290 // amarilla aperturaAnual := 8290 //T // IBEX 2815 3980 5935 7300 9260 11020 12720 15980 // azul marino trimestrales.concat(array.from(2815,3980,5935,7300,9260,11020,12720,15980)) //S // IBEX 5450 6634 8080 10100 11780 14120 // azul claro semanal.concat(array.from(5450,6634,8080,10100,11780,14120)) //P // IBEX 0.1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 // azul oscuro psicologicas.concat(array.from(0.1,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000)) //D // IBEX 2940 3325 3635 4280 4760 5250 6140 6425 6854 7072 7508 7665 7771 7967 8375 8452 8538 8648 8785 8901 8999 9118 9165 9208 9304 9360 9554 9655 10510 11480 12030 12475 13530 14670 15330 // rojo diarias.concat(array.from(2940,3325,3635,4280,4760,5250,6140,6425,6854,7072,7508,7665,7771,7967,8375,8452,8538,8648,8785,8901,8999,9118,9165,9208,9304,9360,9554,9655,10510,11480,12030,12475,13530,14670,15330)) //C // IBEX // verde oscruro //cortoPlazo.concat(IBEX)) if (intrumento == 'EUR') //A // EURUSD 1.0706 // amarilla aperturaAnual := 1.0706 //T // EURUSD 0.638 0.835 1.034 1.162 1.457 1.60387 // azul marino trimestrales.concat(array.from(0.638,0.835,1.034,1.162,1.457,1.60387)) //S // EURUSD 0.762 0.882 0.959 1.093 1.204 1.275 1.3485 1.494 // azul claro semanal.concat(array.from(0.762,0.882,0.959,1.093,1.204,1.275,1.3485,1.494)) //P // EURUSD 0.1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 // azul oscuro psicologicas.concat(array.from(0.1,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2)) //D // EURUSD 0.7055 0.7935 0.9165 0.973 0.987 1 1.009 1.02235 1.0483 1.0609 1.0837 1.1017 1.11375 1.1483 1.183 1.1909 1.217 1.2243 1.2347 1.2475 1.296 1.3345 1.395 1.4245 1.541 // rojo diarias.concat(array.from(0.7055,0.7935,0.9165,0.973,0.987,1,1.009,1.02235,1.0483,1.0609,1.0837,1.1017,1.11375,1.1483,1.183,1.1909,1.217,1.2243,1.2347,1.2475,1.296,1.3345,1.395,1.4245,1.541)) //C // verde oscruro //cortoPlazo.concat()) if (intrumento == 'Btc') //A // Btc 16616 // amarilla aperturaAnual := 16616 //T // Btc 1036 3900 6609 10000 13853 29300 47500 58350 68971 // azul marino trimestrales.concat(array.from(1036,3900,6609,10000,13853,29300,47500,58350,68971)) //S // Btc 1036 3900 6609 10000 13853 29300 47500 58350 68971 // azul claro semanal.concat(array.from(1036,3900,6609,10000,13853,29300,47500,58350,68971)) //P // Btc 0.1 5000 10000 15000 20000 25000 30000 35000 40000 45000 50000 55000 60000 65000 70000 75000 80000 85000 90000 // azul oscuro psicologicas.concat(array.from(0.1,5000,10000,15000,20000,25000,30000,35000,40000,45000,50000,55000,60000,65000,70000,75000,80000,85000,90000)) //D // Btc 2500 5350 8150 12100 17950 21400 22500 24100 28000 31050 32900 34900 38800 44050 50450 52050 55450 61150 // rojo diarias.concat(array.from(2500,5350,8150,12100,17950,21400,22500,24100,28000,31050,32900,34900,38800,44050,50450,52050,55450,61150)) //C // verde oscruro //cortoPlazo.concat()) if (intrumento == 'Jpy') //A // UsdJpy 130.93 // amarilla aperturaAnual := 130.93 //T // UsdJpy 75.575 101.2 124.1 159 215.5 259.9 293.5 // azul marino trimestrales.concat(array.from(75.575,101.2,124.1,159,215.5,259.9,293.5)) //S // UsdJpy 88.6 110.55 134.2 146.4 181.6 197.8 239.4 275.9 // azul claro semanal.concat(array.from(88.6,110.55,134.2,146.4,181.6,197.8,239.4,275.9)) //P // UsdJpy 0.1 50 100 150 200 250 300 // azul oscuro psicologicas.concat(array.from(0.1,50,100,150,200,250,300)) //D // UsdJpy 77.92 79.7 81.7 83.12 84.18 85.86 91.12 92.36 94.12 96.94 103.32 104.78 106.12 107.82 109.24 113.48 115.4 118.06 120.3 121.82 125.3 127.36 130.44 136.4 140.14 142.88 152.4 163.4 174.4 187.6 193.8 201.5 209.4 220.4 228.8 234 242.1 246.8 251.6 266 // rojo diarias.concat(array.from(77.92,79.7,81.7,83.12,84.18,85.86,91.12,92.36,94.12,96.94,103.32,104.78,106.12,107.82,109.24,113.48,115.4,118.06,120.3,121.82,125.3,127.36,130.44,136.4,140.14,142.88,152.4,163.4,174.4,187.6,193.8,201.5,209.4,220.4,228.8,234,242.1,246.8,251.6,266)) //C // verde oscruro //cortoPlazo.concat()) if (intrumento == 'HanSeng') //A // HangSeng 19717 // amarilla aperturaAnual := 19717 //T // HangSeng 10720 11320 14180 18140 22790 26260 28620 31113 33510 // azul marino trimestrales.concat(array.from(10720,11320,14180,18140,22790,26260,28620,31113,33510)) //S // HangSeng 11320 14790 16900 19970 21220 24420 27450 30140 32000 // azul claro semanal.concat(array.from(11320,14790,16900,19970,21220,24420,27450,30140,32000)) //P // HangSeng 0.1 10000 15000 20000 25000 30000 35000 40000 // azul oscuro psicologicas.concat(array.from(0.1,10000,15000,20000,25000,30000,35000,40000)) //D // HangSeng 12940 15980 18470 19480 20730 21720 22205 23660 25000 25580 26870 29320 // rojo diarias.concat(array.from(12940,15980,18470,19480,20730,21720,22205,23660,25000,25580,26870,29320)) //C // verde oscruro //cortoPlazo.concat()) if (intrumento == 'FTSE') //A // FTSE 7468 // amarilla aperturaAnual := 7468 //T // FTSE 995 1708 3460 4828 6750 7905 // azul marino trimestrales.concat(array.from(995,1708,3460,4828,6750,7905)) //S // FTSE 2445 4225 5895 7262 // azul claro semanal.concat(array.from(2445,4225,5895,7262)) //P // FTSE 0.1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 // azul oscuro psicologicas.concat(array.from(0.1,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000)) //D // FTSE 8028 7794 7690 7600 7440 7122 6920 6516 6304 6124 5660 5336 5084 4518 3972 2975 2670 2030 1350 // rojo diarias.concat(array.from(8028,7794,7690,7600,7440,7122,6920,6516,6304,6124,5660,5336,5084,4518,3972,2975,2670,2030,1350)) //C // verde oscruro //cortoPlazo.concat()) if (intrumento == 'Gpb') //A // GpbUsd 1.21 // amarilla aperturaAnual := 1.21 //T // GpbUsd 1.0328 1.4244 1.6845 2.004 2.4475 // azul marino trimestrales.concat(array.from(1.0328,1.4244,1.6845,2.004,2.4475)) //S // GpbUsd 1.2446 1.573 1.854 2.116 2.312 // azul claro semanal.concat(array.from(1.2446,1.573,1.854,2.116,2.312)) //P // GpbUsd 0.1 1 1.25 1.5 1.75 2 2.25 2.5 2.75 3 // azul oscuro psicologicas.concat(array.from(0.1,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3)) //D // GpbUsd 1.0932 1.1452 1.1842 1.226 1.2644 1.2814 1.3006 1.32 1.3446 1.3614 1.3749 1.4042 1.454 1.4752 1.5108 1.5298 1.548 1.5858 1.6258 1.6555 1.67 1.718 1.748 1.78 1.813 1.8755 1.914 1.949 1.973 2.065 2.2 2.368 // rojo diarias.concat(array.from(1.0932,1.1452,1.1842,1.226,1.2644,1.2814,1.3006,1.32,1.3446,1.3614,1.3749,1.4042,1.454,1.4752,1.5108,1.5298,1.548,1.5858,1.6258,1.6555,1.67,1.718,1.748,1.78,1.813,1.8755,1.914,1.949,1.973,2.065,2.2,2.368)) //C // verde oscruro //cortoPlazo.concat()) if (intrumento == 'ASX') //A // ASX 7077 // amarilla aperturaAnual := 7077 //T // ASX 3185 4385 5635 6851 7665 // azul marino trimestrales.concat(array.from(3185,4385,5635,6851,7665)) //S // ASX 2693 3805 4721 5020 5975 6403 7130 // azul claro semanal.concat(array.from(2693,3805,4721,5020,5975,6403,7130)) //P // ASX 0.1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 // azul oscuro psicologicas.concat(array.from(0.1,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000)) //D // ASX 2837 2955 3080 3321 3471 3568 3720 4021 4180 4448 4599 4833 4892 5165 5348 5507 5787 5877 6098 6202 6451 6554 6647 6747 6911 7018 7248 7379 7555 // rojo diarias.concat(array.from(2837,2955,3080,3321,3471,3568,3720,4021,4180,4448,4599,4833,4892,5165,5348,5507,5787,5877,6098,6202,6451,6554,6647,6747,6911,7018,7248,7379,7555)) //C // verde oscruro //cortoPlazo.concat()) if (intrumento == 'PXI') //A // PXI CAC40 64 // amarilla aperturaAnual := 6481.2 //T // PXI CAC40 2465 4305 6125 6945 // azul marino trimestrales.concat(array.from(2465,4305,6125,6945)) //S // PXI CAC40 3520 5245 6375 7402 // azul claro semanal.concat(array.from(3520,5245,6375,7402)) //P // PXI CAC40 0.1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 // azul oscuro psicologicas.concat(array.from(0.1,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000)) //D // PXI CAC40 914 1112 1312 1474 1748 2018 2306 2692 3044 3338 3790 3924 4148 4534 4736 4924 5126 5360 5498 5654 5783 5872 5958 6052 6202 6253 6292 6458 6560 6623 6730 6796 6866 7073 7145 7236 7325 // rojo diarias.concat(array.from(914,1112,1312,1474,1748,2018,2306,2692,3044,3338,3790,3924,4148,4534,4736,4924,5126,5360,5498,5654,5783,5872,5958,6052,6202,6253,6292,6458,6560,6623,6730,6796,6866,7073,7145,7236,7325)) //C // verde oscruro //cortoPlazo.concat()) if (intrumento == 'Nikkei') //A // Nikkei 25867.1 // amarilla aperturaAnual :=25867.1 //T // Nikkei 7950 18210 24100 33000 38950 // azul marino trimestrales.concat(array.from(7950,18210,24100,33000,38950)) //S // Nikkei 7210 10875 15300 26950 // azul claro semanal.concat(array.from(7210,10875,15300,26950)) //P // Nikkei 0.1 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000 21000 22000 23000 24000 25000 26000 27000 28000 29000 30000 31000 32000 33000 34000 35000 36000 37000 38000 39000 40000 41000 42000 43000 44000 45000 46000 47000 48000 49000 50000 // azul oscuro psicologicas.concat(array.from(0.1,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,18000,19000,20000,21000,22000,23000,24000,25000,26000,27000,28000,29000,30000,31000,32000,33000,34000,35000,36000,37000,38000,39000,40000,41000,42000,43000,44000,45000,46000,47000,48000,49000,50000)) //D // Nikkei 8355 9155 9655 10200 11365 11975 12470 13170 13895 14310 14795 15670 16425 17260 18780 19170 19980 20940 21700 22930 25060 25860 26545 27680 28400 29270 30050 30415 31580 33350 34450 35020 35740 36350 37670 // rojo diarias.concat(array.from(8355,9155,9655,10200,11365,11975,12470,13170,13895,14310,14795,15670,16425,17260,18780,19170,19980,20940,21700,22930,25060,25860,26545,27680,28400,29270,30050,30415,31580,33350,34450,35020,35740,36350,37670)) //C // verde oscruro //cortoPlazo.concat())// verde oscruro // Create the labels on the chart's last bar if barstate.islast and _mostrarCotasHistoricas if((aperturaAnuallimiteInferior) or mostrarTodas) f_cotaHistorica(aperturaAnual, amarillo) f_label_derecha(aperturaAnual,"A") // Crea una línea horizontal por cada valor en el array for i = 0 to (array.size(trimestrales) - 1) if(trimestrales.size()>0) if((array.get(trimestrales,i)limiteInferior) or mostrarTodas) f_cotaHistorica(array.get(trimestrales,i), azulMarino) f_label_derecha(array.get(trimestrales,i),"T") for i = 0 to (array.size(semanal) - 1) if(semanal.size()>0) if((array.get(semanal,i)limiteInferior) or mostrarTodas) f_cotaHistorica(array.get(semanal,i), azulClaro) f_label_derecha(array.get(semanal,i),"S") for i = 0 to (array.size(psicologicas) - 1) if(psicologicas.size()>0) if((array.get(psicologicas,i)limiteInferior) or mostrarTodas) f_cotaHistorica(array.get(psicologicas,i), azulOscuro) f_label_derecha(array.get(psicologicas,i),"P") for i = 0 to (array.size(diarias) - 1) if(diarias.size()>0) if((array.get(diarias,i)limiteInferior) or mostrarTodas) f_cotaHistorica(array.get(diarias,i), rojo) f_label_derecha(array.get(diarias,i),"D") for i = 0 to (array.size(cortoPlazo) - 1) if(cortoPlazo.size()>0) if((array.get(cortoPlazo,i)limiteInferior) or mostrarTodas) f_cotaHistorica(array.get(cortoPlazo,i), verdeOscruo) f_label_derecha(array.get(cortoPlazo,i),"C") if barstate.islast and mostrarNombreTickerActual label.new(x=bar_index, y=high, text=syminfo.ticker, color=color.new(color.blue, 0), textcolor=color.white) if barstate.islast and intrumento=='' label.new(x=bar_index, y=high, text="No se ha podido asociar el ticker actual [" + syminfo.ticker + "] con ningún activo.\nEl instrumento parametrizado es ["+ intrumentoParametrizado + "].\nEl nombre del activo buscado es [" + intrumento +"].\nRevise la lista de tickers correspondiente al instrumento que está visualizando y añada el nombre de este ticker.", color=color.orange, textcolor=color.black, textalign = text.align_left) //////FIN DE MULTICOTAS //////COTAS DIARIAS bool INDICES_EUROPEOS = syminfo.ticker == "DE30EUR" or syminfo.ticker == "GRXEUR" or syminfo.ticker == "GER30" or syminfo.ticker == "DE40" or syminfo.ticker == "SPA35" or syminfo.ticker =="UK100" bool INDICES_AMERICANOS = syminfo.ticker == "US30" or syminfo.ticker == "US100" or syminfo.ticker == "US500" or syminfo.ticker =="NAS100" or syminfo.ticker=="EURUSD" europeos = timestamp("CET",year, month, dayofmonth, 8, 0) // A LAS 8 DE LA MAÑANA americanos = timestamp("CET",year, month, dayofmonth, 2, 0) // EN VERANO A LAS 2 , EN INVIERNO A LAS 1 _m = 0 // Minute: 0 var hora_ocho = hour(europeos) var hora_una = hour(americanos) EUROPEO = (hour(time) == hora_ocho) and (minute(time) == _m) AMERICANOS= (hour(time) == hora_una) and (minute(time) == _m) var line apertura = na var float precio = na precio := open var line r1 = na var line r2 = na var line r3 = na var line r4 = na var line r5 = na var line r5a = na var line r6 = na var line r7 = na var line r8 = na var line r9 = na var line r10 = na var line r11 = na var line s1 = na var line s2 = na var line s3 = na var line s4 = na var line s5 = na var line s5a = na var line s6 = na var line s7 = na var line s8 = na var line s9 = na var line s10 = na var line s11 = na if INDICES_EUROPEOS if (EUROPEO) apertura := line.new(bar_index, precio, bar_index+1, precio, extend=extend.right, style=line.style_solid,color=color.rgb(4, 150, 41), width=4) r1 := line.new(bar_index, precio*1.00236, bar_index+1, precio*1.00236, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r2 := line.new(bar_index, precio*1.00382, bar_index+1, precio*1.00382, extend=extend.right,style=line.style_dashed, color=color.black,width=1) r3 := line.new(bar_index, precio*1.005, bar_index+1, precio*1.005, extend=extend.right,style=line.style_solid, color=color.black, width=3) r4:= line.new(bar_index, precio*1.00618, bar_index+1, precio*1.00618, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r5 := line.new(bar_index, precio*1.00762, bar_index+1, precio*1.00762, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r5a := line.new(bar_index, precio*1.00882, bar_index+1, precio*1.00882, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r6 := line.new(bar_index, precio*1.01, bar_index+1, precio*1.01, extend=extend.right,style=line.style_solid, color=color.black, width=3) r7 := line.new(bar_index, precio*1.01236, bar_index+1, precio*1.01236, extend=extend.right, style=line.style_dashed,color=color.black, width=1) r8:= line.new(bar_index, precio*1.01382, bar_index+1, precio*1.01382, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r9 := line.new(bar_index, precio*1.015, bar_index+1, precio*1.015, extend=extend.right,style=line.style_solid, color=color.black, width=3) r10 := line.new(bar_index, precio*1.02, bar_index+1, precio*1.02, extend=extend.right,style=line.style_solid, color=color.black, width=1) r11:= line.new(bar_index, precio*1.025, bar_index+1, precio*1.025, extend=extend.right,style=line.style_solid, color=color.black, width=3) s1 := line.new(bar_index, precio/1.00236, bar_index+1, precio/1.00236, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s2 := line.new(bar_index, precio/1.00382, bar_index+1, precio/1.00382, extend=extend.right,style=line.style_dashed, color=color.black,width=1) s3 := line.new(bar_index, precio/1.005, bar_index+1, precio/1.005, extend=extend.right,style=line.style_solid, color=color.black, width=3) s4:= line.new(bar_index, precio/1.00618, bar_index+1, precio/1.00618, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s5 := line.new(bar_index, precio/1.00762, bar_index+1, precio/1.00762, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s5a := line.new(bar_index, precio/1.00882, bar_index+1, precio/1.00882, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s6 := line.new(bar_index, precio/1.01, bar_index+1, precio/1.01, extend=extend.right,style=line.style_solid, color=color.black, width=3) s7 := line.new(bar_index, precio/1.01236, bar_index+1, precio/1.01236, extend=extend.right, style=line.style_dashed,color=color.black, width=1) s8:= line.new(bar_index, precio/1.01382, bar_index+1, precio/1.01382, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s9 := line.new(bar_index, precio/1.015, bar_index+1, precio/1.015, extend=extend.right,style=line.style_solid, color=color.black, width=3) s10 := line.new(bar_index, precio/1.02, bar_index+1, precio/1.02, extend=extend.right,style=line.style_solid, color=color.black, width=1) s11:= line.new(bar_index, precio/1.025, bar_index+1, precio/1.025, extend=extend.right,style=line.style_solid, color=color.black, width=3) ///////////////// ETIQUETAS ///////////////////////// label label_apertura = label.new(chart.right_visible_bar_time, precio, "APERTURA", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size = size.small) label label_r1 = label.new(chart.right_visible_bar_time, precio*1.00236, "R1", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r2 = label.new(chart.right_visible_bar_time, precio*1.00382, "R2", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r3 = label.new(chart.right_visible_bar_time, precio*1.005, "R3", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r4 = label.new(chart.right_visible_bar_time, precio*1.00618, "R4", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r5 = label.new(chart.right_visible_bar_time, precio*1.00762, "R5", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r5a = label.new(chart.right_visible_bar_time, precio*1.00882, "R5a", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r6 = label.new(chart.right_visible_bar_time, precio*1.01, "R6", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r7 = label.new(chart.right_visible_bar_time, precio*1.01236, "R7", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r8 = label.new(chart.right_visible_bar_time, precio*1.01382, "R8", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r9 = label.new(chart.right_visible_bar_time, precio*1.015, "R9", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r10 = label.new(chart.right_visible_bar_time, precio*1.02, "R10", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r11 = label.new(chart.right_visible_bar_time, precio*1.025, "R11", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s1 = label.new(chart.right_visible_bar_time, precio/1.00236, "S1", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s2 = label.new(chart.right_visible_bar_time, precio/1.00382, "S2", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s3 = label.new(chart.right_visible_bar_time, precio/1.005, "S3", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s4 = label.new(chart.right_visible_bar_time, precio/1.00618, "S4", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s5 = label.new(chart.right_visible_bar_time, precio/1.00762, "S5", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s5a = label.new(chart.right_visible_bar_time, precio/1.00882, "S5a", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s6 = label.new(chart.right_visible_bar_time, precio/1.01, "S6", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s7 = label.new(chart.right_visible_bar_time, precio/1.01236, "S7", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s8 = label.new(chart.right_visible_bar_time, precio/1.01382, "S8", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s9 = label.new(chart.right_visible_bar_time, precio/1.015, "S9", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s10 = label.new(chart.right_visible_bar_time, precio/1.02, "S10", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s11 = label.new(chart.right_visible_bar_time, precio/1.025, "S11", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label.delete(label_apertura[1]) label.delete(label_r1[1]) label.delete(label_r2[1]) label.delete(label_r3[1]) label.delete(label_r4[1]) label.delete(label_r5[1]) label.delete(label_r5a[1]) label.delete(label_r6[1]) label.delete(label_r7[1]) label.delete(label_r8[1]) label.delete(label_r9[1]) label.delete(label_r10[1]) label.delete(label_r11[1]) label.delete(label_s1[1]) label.delete(label_s2[1]) label.delete(label_s3[1]) label.delete(label_s4[1]) label.delete(label_s5[1]) label.delete(label_s5a[1]) label.delete(label_s6[1]) label.delete(label_s7[1]) label.delete(label_s8[1]) label.delete(label_s9[1]) label.delete(label_s10[1]) label.delete(label_s11[1]) ///////////////////////// FIN ETIQUETAS ////////////////////////////// line.delete(apertura[1]) line.delete(r1[1]) line.delete(r2[1]) line.delete(r3[1]) line.delete(r4[1]) line.delete(r5[1]) line.delete(r5a[1]) line.delete(r6[1]) line.delete(r7[1]) line.delete(r8[1]) line.delete(r9[1]) line.delete(r10[1]) line.delete(r11[1]) line.delete(s1[1]) line.delete(s2[1]) line.delete(s3[1]) line.delete(s4[1]) line.delete(s5[1]) line.delete(s5a[1]) line.delete(s6[1]) line.delete(s7[1]) line.delete(s8[1]) line.delete(s9[1]) line.delete(s10[1]) line.delete(s11[1]) else if INDICES_AMERICANOS if (AMERICANOS) apertura := line.new(bar_index, precio, bar_index+1, precio, extend=extend.right, style=line.style_solid,color=color.rgb(4, 150, 41), width=4) r1 := line.new(bar_index, precio*1.00236, bar_index+1, precio*1.00236, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r2 := line.new(bar_index, precio*1.00382, bar_index+1, precio*1.00382, extend=extend.right,style=line.style_dashed, color=color.black,width=1) r3 := line.new(bar_index, precio*1.005, bar_index+1, precio*1.005, extend=extend.right,style=line.style_solid, color=color.black, width=3) r4:= line.new(bar_index, precio*1.00618, bar_index+1, precio*1.00618, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r5 := line.new(bar_index, precio*1.00762, bar_index+1, precio*1.00762, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r5a := line.new(bar_index, precio*1.00882, bar_index+1, precio*1.00882, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r6 := line.new(bar_index, precio*1.01, bar_index+1, precio*1.01, extend=extend.right,style=line.style_solid, color=color.black, width=3) r7 := line.new(bar_index, precio*1.01236, bar_index+1, precio*1.01236, extend=extend.right, style=line.style_dashed,color=color.black, width=1) r8:= line.new(bar_index, precio*1.01382, bar_index+1, precio*1.01382, extend=extend.right,style=line.style_dashed, color=color.black, width=1) r9 := line.new(bar_index, precio*1.015, bar_index+1, precio*1.015, extend=extend.right,style=line.style_solid, color=color.black, width=3) r10 := line.new(bar_index, precio*1.02, bar_index+1, precio*1.02, extend=extend.right,style=line.style_solid, color=color.black, width=1) r11:= line.new(bar_index, precio*1.025, bar_index+1, precio*1.025, extend=extend.right,style=line.style_solid, color=color.black, width=3) s1 := line.new(bar_index, precio/1.00236, bar_index+1, precio/1.00236, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s2 := line.new(bar_index, precio/1.00382, bar_index+1, precio/1.00382, extend=extend.right,style=line.style_dashed, color=color.black,width=1) s3 := line.new(bar_index, precio/1.005, bar_index+1, precio/1.005, extend=extend.right,style=line.style_solid, color=color.black, width=3) s4:= line.new(bar_index, precio/1.00618, bar_index+1, precio/1.00618, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s5 := line.new(bar_index, precio/1.00762, bar_index+1, precio/1.00762, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s5a := line.new(bar_index, precio/1.00882, bar_index+1, precio/1.00882, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s6 := line.new(bar_index, precio/1.01, bar_index+1, precio/1.01, extend=extend.right,style=line.style_solid, color=color.black, width=3) s7 := line.new(bar_index, precio/1.01236, bar_index+1, precio/1.01236, extend=extend.right, style=line.style_dashed,color=color.black, width=1) s8:= line.new(bar_index, precio/1.01382, bar_index+1, precio/1.01382, extend=extend.right,style=line.style_dashed, color=color.black, width=1) s9 := line.new(bar_index, precio/1.015, bar_index+1, precio/1.015, extend=extend.right,style=line.style_solid, color=color.black, width=3) s10 := line.new(bar_index, precio/1.02, bar_index+1, precio/1.02, extend=extend.right,style=line.style_solid, color=color.black, width=1) s11:= line.new(bar_index, precio/1.025, bar_index+1, precio/1.025, extend=extend.right,style=line.style_solid, color=color.black, width=3) ///////////////// ETIQUETAS ///////////////////////// label label_apertura = label.new(chart.right_visible_bar_time, precio, "APERTURA", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size = size.small) label label_r1 = label.new(chart.right_visible_bar_time, precio*1.00236, "R1", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r2 = label.new(chart.right_visible_bar_time, precio*1.00382, "R2", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r3 = label.new(chart.right_visible_bar_time, precio*1.005, "R3", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r4 = label.new(chart.right_visible_bar_time, precio*1.00618, "R4", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r5 = label.new(chart.right_visible_bar_time, precio*1.00762, "R5", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r5a = label.new(chart.right_visible_bar_time, precio*1.00882, "R5a", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r6 = label.new(chart.right_visible_bar_time, precio*1.01, "R6", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r7 = label.new(chart.right_visible_bar_time, precio*1.01236, "R7", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r8 = label.new(chart.right_visible_bar_time, precio*1.01382, "R8", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r9 = label.new(chart.right_visible_bar_time, precio*1.015, "R9", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r10 = label.new(chart.right_visible_bar_time, precio*1.02, "R10", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_r11 = label.new(chart.right_visible_bar_time, precio*1.025, "R11", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s1 = label.new(chart.right_visible_bar_time, precio/1.00236, "S1", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s2 = label.new(chart.right_visible_bar_time, precio/1.00382, "S2", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s3 = label.new(chart.right_visible_bar_time, precio/1.005, "S3", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s4 = label.new(chart.right_visible_bar_time, precio/1.00618, "S4", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s5 = label.new(chart.right_visible_bar_time, precio/1.00762, "S5", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s5a = label.new(chart.right_visible_bar_time, precio/1.00882, "S5a", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s6 = label.new(chart.right_visible_bar_time, precio/1.01, "S6", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s7 = label.new(chart.right_visible_bar_time, precio/1.01236, "S7", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s8 = label.new(chart.right_visible_bar_time, precio/1.01382, "S8", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s9 = label.new(chart.right_visible_bar_time, precio/1.015, "S9", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s10 = label.new(chart.right_visible_bar_time, precio/1.02, "S10", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label label_s11 = label.new(chart.right_visible_bar_time, precio/1.025, "S11", xloc=xloc.bar_time, style=label.style_none, textcolor=color.black,size=size.small) label.delete(label_apertura[1]) label.delete(label_r1[1]) label.delete(label_r2[1]) label.delete(label_r3[1]) label.delete(label_r4[1]) label.delete(label_r5[1]) label.delete(label_r5a[1]) label.delete(label_r6[1]) label.delete(label_r7[1]) label.delete(label_r8[1]) label.delete(label_r9[1]) label.delete(label_r10[1]) label.delete(label_r11[1]) label.delete(label_s1[1]) label.delete(label_s2[1]) label.delete(label_s3[1]) label.delete(label_s4[1]) label.delete(label_s5[1]) label.delete(label_s5a[1]) label.delete(label_s6[1]) label.delete(label_s7[1]) label.delete(label_s8[1]) label.delete(label_s9[1]) label.delete(label_s10[1]) label.delete(label_s11[1]) ///////////////////////// FIN ETIQUETAS ////////////////////////////// line.delete(apertura[1]) line.delete(r1[1]) line.delete(r2[1]) line.delete(r3[1]) line.delete(r4[1]) line.delete(r5[1]) line.delete(r5a[1]) line.delete(r6[1]) line.delete(r7[1]) line.delete(r8[1]) line.delete(r9[1]) line.delete(r10[1]) line.delete(r11[1]) line.delete(s1[1]) line.delete(s2[1]) line.delete(s3[1]) line.delete(s4[1]) line.delete(s5[1]) line.delete(s5a[1]) line.delete(s6[1]) line.delete(s7[1]) line.delete(s8[1]) line.delete(s9[1]) line.delete(s10[1]) line.delete(s11[1]) /////FIN COTAS DIARIAS // AZUL MARINO →Cambio de secuencia a Alcista // VERDE OSCURA→ Impulso alcista con FUERZA // ROJA →Seguimos en Impulso Alcista con FUERZA pero estamos en corrección // DOBLE ROJA→ Ir zona de corrección como MÍNIMO // AMARILLA →Seguimos Alcistas pero SIN FUERZA // AZUL →Alcista en dirección Impulso pero SIN FUERZA // VERDE-AZUL→ Señal de inicio de nuevo Rally // FUCSIA→ Cambio de secuencia a Bajista // MARRON OSCURO → FUERZA BAJISTA // VERDE→ Seguimos impulso bajista CON FUERZA pero estamos en corrección // NARANJA→ Intento de volver en la dirección del impulso bajista pero SIN FUERZA // NARANJA MARRON→ REINICIO de impulso Bajista CON Fuerza ///////////////////////////// INDICADOR ADX ///////////////////////// adxlen = input(7, title="ADX Smoothing") dilen = input(7, title="DI Length") dirmov(len) => up = ta.change(high) down = -ta.change(low) plusDM = na(up) ? na : (up > down and up > 0 ? up : 0) minusDM = na(down) ? na : (down > up and down > 0 ? down : 0) truerange = ta.rma(ta.tr, len) plus = fixnan(100 * ta.rma(plusDM, len) / truerange) minus = fixnan(100 * ta.rma(minusDM, len) / truerange) [plus, minus] adx(dilen, adxlen) => [plus, minus] = dirmov(dilen) sum = plus + minus adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen) sig = adx(dilen, adxlen) ///////////////////////////// FIN INDICADOR ADX /////////////////////////// // Parámetros periodoWilliams = input.int(40, title="Período Williams %R") // Cálculo de indicadores wpr = ta.wpr(periodoWilliams) // Condición para cambiar el color de las velas colorbordes=color.new(color.gray,0) colormecha=color.new(color.gray,0) // Dibujar las velas con los colores definidos barcolor(wpr < -50 and (sig >=sig[1] and wpr>wpr[1]) ? color.rgb(0, 255, 0): (wpr > -50 and wpr < -27) and (sig>=sig[1] and wpr>wpr[1]) ? color.rgb(120, 185, 70) : wpr> -27 and (sig>=sig[1] and wpr > wpr[1]) ? color.rgb(70,100,70):wpr> -50 and (sig<=sig[1]and wpr-50 and (sig>=sig[1]and wpr-72) and (sig>=sig[1] and wpr=sig[1] and wprwpr[1]) ? color.rgb(0,255,255):wpr>-50 and (sig<=sig[1] and wpr>wpr[1])? color.rgb(30, 180, 230):wpr<-50 ? color.rgb(255,0,255) : wpr> -50?color.rgb(0,0,150):color.gray,title="Barras de Colores")