Hi Guys,
I'm looking for the lowest open() or close() and the highest open() or close() in the last 14 candles. The following works but returns over 40 values.... might be because its 5 in the morning but i just can't see how it does it... any ideas ? Seems to me there should only be 14 values returned.
t_MHigh = null;
t_MLow = null;
i = 1;
while (i <= 14){
if(t_MHigh == null || close(-i) > t_MHigh) t_MHigh = close(-i);
if(open(-i) > t_MHigh) t_MHigh = open(-i);
if(t_MLow == null || close(-i) < t_MLow) t_MLow = close(-i);
if(open(-i) < t_MLow) t_MLow = open(-i);
debugPrintln( t_MHigh + " " + t_MooseLow + "\n");
i = i + 1;
}
maybe just a better way ?
I'm looking for the lowest open() or close() and the highest open() or close() in the last 14 candles. The following works but returns over 40 values.... might be because its 5 in the morning but i just can't see how it does it... any ideas ? Seems to me there should only be 14 values returned.
t_MHigh = null;
t_MLow = null;
i = 1;
while (i <= 14){
if(t_MHigh == null || close(-i) > t_MHigh) t_MHigh = close(-i);
if(open(-i) > t_MHigh) t_MHigh = open(-i);
if(t_MLow == null || close(-i) < t_MLow) t_MLow = close(-i);
if(open(-i) < t_MLow) t_MLow = open(-i);
debugPrintln( t_MHigh + " " + t_MooseLow + "\n");
i = i + 1;
}
maybe just a better way ?
Comment