Here's part of my code:
The way I am used to things, the value of PrevDynamic_S from the last debug statement should equal the value of the first debug statement on the next bar BUT IT DOESN'T!
Can someone please explain what's going on or where my "mistake" is?
Thanks:
See below:
PHP Code:
debugPrint( "1 PrevDynamic_S: " + ( Dynamic_S ) + "\n" );
PrevDynamic_R = Dynamic_R ;
PrevDynamic_S = Dynamic_S ;
debugPrint( "2 PrevDynamic_S: " + ( Dynamic_S ) + "\n" );
var xHH = highest( iPeriods , high() ) ; // dynamic Resistance
var xLL = lowest( iPeriods , low() ) ; // dynamic Suport
Dynamic_R = formatPriceNumber(xHH)*1 ; // dynamic Resistance
Dynamic_S = formatPriceNumber(xLL)*1 // dynamic Suport
if ( Dynamic_R != high(0) && Dynamic_R < PrevDynamic_R ) {
if ( PrevDynamic_R != 0 ) {
Dynamic_R = PrevDynamic_R;
}
}
if ( Dynamic_S != low(0) && Dynamic_S > PrevDynamic_S ) {
if ( PrevDynamic_S != 0 ) {
Dynamic_S = PrevDynamic_S;
}
}
debugPrint( "PrevDynamic_S: " + ( Dynamic_S ) + "\n" );
The way I am used to things, the value of PrevDynamic_S from the last debug statement should equal the value of the first debug statement on the next bar BUT IT DOESN'T!
Can someone please explain what's going on or where my "mistake" is?
Thanks:
See below:
Comment