jonirrenicus: me gustaría ayudar con el código
. Vi un video del enfoque y parece ser un pan comido. En cuanto al código ZigZag, se puede escribir sin la necesidad de una matriz y más corto
. No hay nada malo con lo que proporciona chunshuo. Fue rápido y sabe lo que está haciendo. Por ejemplo, para simplificar las cosas, solo crearía una función y luego la llamaría en el inicio principal (). Algo como esto: if (ZigZagTrend () == 1) {hacer algo; } o si (ZigZagTrend () == - 1) {haz algo;} Esta es la función, no hay necesidad de una matriz y menos líneas de código. Así que es fasssssterrrrr LOl
. Código insertado int ZigZagTrend () {int result = 0; doble ZigZag, zz1 = 0, zz2 = 0; para (int Count = 0; Countlt; = Bars; Count ) {ZigZag = iCustom (NULL, 0, ZigZag, Depth, Deviation, Backstep, 0, Count); if (ZigZag! = EMPTY_VALUE zz1 == 0) zz1 = ZigZag; if (ZigZag! = EMPTY_VALUE zz1! = 0) {zz2 = ZigZag; descanso; }} if (zz1gt; zz2) resultado = 1;/ZigZag Trend está arriba si ((zz1lt; zz2) resultado = -1;/ZigZag Trend está fuera de retorno (resultado);} Peace Jess