how to check if last price is the highest on current bar

 

Hello,

I am new to MQL5 programming. 

I want to check if the last price (from MqlTick structure) is the highest on the current timeframe bar. I coded something like:

if (last_price.last=mrate[0].high) and I receive an warning "expression not boolean", which is very correct, but I have no other ideea how to code this. 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Chart Timeframes
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Chart Timeframes
  • www.mql5.com
Standard Constants, Enumerations and Structures / Chart Constants / Chart Timeframes - Documentation on MQL5
 
tenlau:

Hello,

I am new to MQL5 programming. 

I want to check if the last price (from MqlTick structure) is the highest on the current timeframe bar. I coded something like:

if (last_price.last=mrate[0].high) and I receive an warning "expression not boolean", which is very correct, but I have no other ideea how to code this. 

Try

if (last_price.last  ==  mrate[0].high)
 
Thank you, it works!
Reason: