Hi,
I am trying to plot arrows based on Bill William's Third wise man. I am looking for five price bars at a time and comparing High values. If the middle high is higher than previous two highs and next two highs, I want to plot up Arrow symbol. However with the following code, I end up plotting uparrow on every bar (even when value of tmp is false). What am I doing wrong here?
for( i = 3; i < (BarCount-2); i++ )
{
tmp = (High > High[i-1]) AND (High[i-1] > High[i-2]) AND (High > High[i+1]) AND (High[i+1] > High[i+2]);
//_TRACE("tmp : " + tmp);
PlotShapes( IIf( tmp, shapeUpArrow, shapeNone ), colorGreen,0, H,10 );
}
I am trying to plot arrows based on Bill William's Third wise man. I am looking for five price bars at a time and comparing High values. If the middle high is higher than previous two highs and next two highs, I want to plot up Arrow symbol. However with the following code, I end up plotting uparrow on every bar (even when value of tmp is false). What am I doing wrong here?
for( i = 3; i < (BarCount-2); i++ )
{
tmp = (High > High[i-1]) AND (High[i-1] > High[i-2]) AND (High > High[i+1]) AND (High[i+1] > High[i+2]);
//_TRACE("tmp : " + tmp);
PlotShapes( IIf( tmp, shapeUpArrow, shapeNone ), colorGreen,0, H,10 );
}