for ( int i = limit; i >= 0; i-- )
{
if ( Low[i-1] > Low[i]
&& Low[i+1] > Low[i]
) Dpivot[i]=Low[i];
}
This stores the Low
price at such bar, where this condition is met into the Dpivot[]
array.
But obviously, on bars that it isn't true, the value is 0.
How can I go about creating an array that has all the 0's skipped out and consists of only the actual prices that show up in Dpivot[]
.
Sorry if this is a really trivial problem. I am very new to programming and MQL4
documentation just leaves me with head pains.
I am really trying to wrap my head around this whole array thing!
My main problem in a lot of instances is to find values when conditions are met, but not being able to reference them again when they are not met, if this makes any sense.
Corpus details will depend a lot on whether you build a Custom Indicator or some other type of the
MQL4
code-execution unitThe principal approach is to fill just non-zero cells into such a new array.