Conversion de Lowess Channel
Forums › ProRealTime forum Français › Support ProBuilder › Conversion de Lowess Channel
- This topic has 1 reply, 2 voices, and was last updated 1 hour ago by
Iván.
Viewing 2 posts - 1 through 2 (of 2 total)
-
-
10/15/2025 at 9:22 AM #25262110/15/2025 at 4:02 PM #252636
voici:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129//--------------------------------------------//PRC_Lowess Channel + (RSI) by ChartPrime//version = 0//15.10.2025//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//--------------------------------------------// --- Parámetros Configurables ---length = 25multi = 2.0bandwidth = 10// Colores de la línea centralcolUpR = 0colUpG = 255colUpB = 0colDnR = 128colDnB = 128colDnG = 0// Color de las bandascolBndsR = 61colBndsG = 145colBndsB = 64// --- Fin de Parámetros ---// --- Cálculos del Indicador en un ÚNICO Bucle ---// Pre-cálculo del ATRatr = AverageTrueRange[200]// Variables de suma compartidas (no dependen de 'y')sumWeights = 0.0sumWeightedX = 0.0sumWeightedX2 = 0.0// Variables de suma específicas para cada una de las 5 líneassumWeightedYm = 0.0sumWeightedXYm = 0.0sumWeightedYh1 = 0.0sumWeightedXYh1 = 0.0sumWeightedYh2 = 0.0sumWeightedXYh2 = 0.0sumWeightedYl1 = 0.0sumWeightedXYl1 = 0.0sumWeightedYl2 = 0.0sumWeightedXYl2 = 0.0FOR i = 0 TO length - 1x = iweight = EXP(-0.5 * (x / bandwidth) * (x / bandwidth))// Definir el valor 'y' para cada líneaym = close[i]yh1 = close[i] + (atr[i] * multi)yh2 = close[i] + (atr[i] * multi * 2)yl1 = close[i] - (atr[i] * multi)yl2 = close[i] - (atr[i] * multi * 2)// Acumular sumas compartidas (solo una vez)sumWeights = sumWeights + weightsumWeightedX = sumWeightedX + weight * xsumWeightedX2 = sumWeightedX2 + weight * x * x// Acumular sumas específicas para cada líneasumWeightedYm = sumWeightedYm + weight * ymsumWeightedXYm = sumWeightedXYm + weight * x * ymsumWeightedYh1 = sumWeightedYh1 + weight * yh1sumWeightedXYh1 = sumWeightedXYh1 + weight * x * yh1sumWeightedYh2 = sumWeightedYh2 + weight * yh2sumWeightedXYh2 = sumWeightedXYh2 + weight * x * yh2sumWeightedYl1 = sumWeightedYl1 + weight * yl1sumWeightedXYl1 = sumWeightedXYl1 + weight * x * yl1sumWeightedYl2 = sumWeightedYl2 + weight * yl2sumWeightedXYl2 = sumWeightedXYl2 + weight * x * yl2NEXT// --- Cálculo final para cada línea (post-bucle) ---meanX = sumWeightedX / sumWeights// Línea mmeanYm = sumWeightedYm / sumWeightsbetam = (sumWeightedXYm - meanX * meanYm * sumWeights) / (sumWeightedX2 - meanX * meanX * sumWeights)alpham = meanYm - betam * meanXm = alpham + betam * (length / 2)// Línea h1meanYh1 = sumWeightedYh1 / sumWeightsbetah1 = (sumWeightedXYh1 - meanX * meanYh1 * sumWeights) / (sumWeightedX2 - meanX * meanX * sumWeights)alphah1 = meanYh1 - betah1 * meanXh1 = alphah1 + betah1 * (length / 2)// Línea h2meanYh2 = sumWeightedYh2 / sumWeightsbetah2 = (sumWeightedXYh2 - meanX * meanYh2 * sumWeights) / (sumWeightedX2 - meanX * meanX * sumWeights)alphah2 = meanYh2 - betah2 * meanXh2 = alphah2 + betah2 * (length / 2)// Línea l1meanYl1 = sumWeightedYl1 / sumWeightsbetal1 = (sumWeightedXYl1 - meanX * meanYl1 * sumWeights) / (sumWeightedX2 - meanX * meanX * sumWeights)alphal1 = meanYl1 - betal1 * meanXl1 = alphal1 + betal1 * (length / 2)// Línea l2meanYl2 = sumWeightedYl2 / sumWeightsbetal2 = (sumWeightedXYl2 - meanX * meanYl2 * sumWeights) / (sumWeightedX2 - meanX * meanX * sumWeights)alphal2 = meanYl2 - betal2 * meanXl2 = alphal2 + betal2 * (length / 2)// --- Lógica de Color para la línea central ---IF m > m[3] THENcolorR = colUpRcolorG = colUpGcolorB = colUpBELSIF m < m[3] THENcolorR = colDnRcolorG = colDnGcolorB = colDnBENDIF// --- Dibujado de las líneas ---RETURN h2 COLOURED(colBndsR, colBndsG, colBndsB) STYLE(dottedline) AS "Higher Band 2", h1 COLOURED(colBndsR, colBndsG, colBndsB) STYLE(dottedline) AS "Higher Band 1", m COLOURED(colorR, colorG, colorB) STYLE(line, 2) AS "Middle", l1 COLOURED(colBndsR, colBndsG, colBndsB) STYLE(dottedline) AS "Lower Band 1", l2 COLOURED(colBndsR, colBndsG, colBndsB) STYLE(dottedline) AS "Lower Band 2" -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
Find exclusive trading pro-tools on
Similar topics: