i can detect the lower lows in a downtrend, but need a way to identify the which low is the lowest value.
can you give any examples of how to do this?
many thanks,
can you give any examples of how to do this?
many thanks,
function fFindLL(vbars) {
var x = 0, vLL = 999999999999;
for (x = 0; x > -vBars; x--) {
vLL = Math.min(vLL, low(x));
}
return vLL;
}
// I want to find the lowest low of the last 15 bars
var LL15 = fFindLL(15);
// I want to find the lowest low of the last 7 bars
var LL15 = fFindLL(7);
function fFindLLnB(vbars) {
var x = 0, vLL = 999999999999, vBarID = 0;
for (x = 0; x > -vBars; x--) {
if (low(x) <= vLL) {
vLL = Math.min(vLL, low(x));
vBarID = x;
} // end of conditional if
} // end of for loop
return new Array(vLL, vBarID);
}
var vLLB = fFindLLnB(15);
debugPrintln(" LL:"+ vLLB[0] +" Bar #:"+vLLB[1] );
var priorLow = 99999999;
function main() {
// RESET Low Pattern on a HIGH Series
if ((close(-1) > close(-2)) &&
(close() > close(-1))
) {
priorLow = 99999999;
}
// New Low Pattern : Low Series
if ((close(-1) < close(-2)) &&
(close() > close(-1)) &&
(close(-1) < priorLow)
){
vColor=Color.fushcia;
priorLow = close(-1);
}
return;
} // end of main
Comment