Quick question on a piece of code..
investguy: is there any logic to this ?
| Print variable values before and inside if statements and find out why. |
in this chart you will find FL[0] = FoundFirst... is there any logic to this ?
Interesting chart. It isn't M1, is it?
What is the code for the Comment()?
You will have something like
"FoundFirst="+FoundFirstHave you perhaps modified a copy & paste and mistakenly coded
"FoundFirst="+FL[0]
I have tried adding a few things to the code and still only getting the first Lower Fractal.. any other clues??
I have tried looking at the results from the Print statements and decided to try and add a few things to the code.. .still not working... is only grabbing the first Lower fractal... int FoundHigh=0; int FoundLow=0; int k=0; while(FoundHigh<=2 && FoundLow<=2) // LAST x UPPER ZIGZAG FRACTALS { double fractal=iCustom(Symbol(),0,"ZigZag",ExtDepth,ExtDeviation,ExtBackstep,0,k); if(fractal==High[k]) // High[counter] { FU[FoundHigh]=fractal; FoundHigh++; } if(fractal==Low[k]) // Low[counter] { FL[FoundLow]=fractal; FoundLow++; } //if (fractal !=0 && FoundFirst == 0) FoundFirst=fractal; //Print( "FoundFirst=",FoundFirst," FL[FoundLow]=",FL[FoundLow]," FL[FoundHigh]=",FL[FoundHigh]); k++; } double FoundFirst=0; int BarCount=0; while(BarCount <= Bars) { if(High[BarCount] == FU[0]) {FoundFirst=FU[0]; break;} if(Low[BarCount] == FL[0]) {FoundFirst=FL[0]; break;} BarCount++; }
What is the code for the Comment()?
You will have something like
Have you perhaps modified a copy & paste and mistakenly coded
Found my mistake... the logic is right but on the comparison in the if statement i used just "=" and not "=="...
wrong --- if(FoundFirst=FL[0]) { right --- if(FoundFirst==FL[0]) {
so the value changed.. thank you guys!!
no thats a renko chart.. check it out .. http://bit.ly/1mHQwr0

Why would FoundFirst always be equal the Low fractal and never update if a high fractal gets updated on this ZigZag scan...