iHigh value

 

Im confused.

I wrote something in loop script and encountered a wired thing.

if(iHigh(NULL,0,xi) == levelnum) {ZV = true;}

it does not work.

first check:

if(1.32 == 1.32){ZV = true;}

It works.

if(1.32 == levelnum){ZV = true;}

it works.

if(iHigh(NULL,0,xi) == levelnum){ZV = true;}

It does not work...

so I printed all values of iHigh to check

1.3300000
1.3200000
1.3100000
1.3000000

What is wrong? Thank for your helps!

 

also,

if(iHigh(NULL,0,xi) ==1.32){ZV = true;}

it does not work, too

 
flying:

Im confused.

I wrote something in loop script and encountered a wired thing.

if(iHigh(NULL,0,xi) == levelnum) {ZV = true;}

it does not work.

Read this: MQL4 - Known Issues and Best Practices

and more specifically, this: Can Price != Price

 
flying:

Im confused.

I wrote something in loop script and encountered a wired thing.

if(iHigh(NULL,0,xi) == levelnum) {ZV = true;}

it does not work.

first check:

if(1.32 == 1.32){ZV = true;}

It works.

if(1.32 == levelnum){ZV = true;}

it works.

if(iHigh(NULL,0,xi) == levelnum){ZV = true;}

It does not work...

so I printed all values of iHigh to check

1.3300000
1.3200000
1.3100000
1.3000000

What is wrong? Thank for your helps!


I'm amazed that you found 4 bars that had such convenient highs, are they really iHigh values?

As you don't show the loop, it's difficult to say, but is it possible that ZV is true for one cycle of the loop and then reset to false on a subsequent cycle?

Show your code and you may get more help

Reason: