comparing two values

 
Hello how can i use Mathmax and mathmin functions if i want to compare yesterday high and hour high

 
Ahmed774:
Hello how can i use Mathmax and mathmin functions if i want to compare yesterday high and hour high

Why would you want to use those 2 functions?

 
Keith Watford:

Why would you want to use those 2 functions?


I want to open an order based on the distance between yesterday low and the day before low so the idea is that when the price exceed yesterday and the day before lows by 5pips the expert open a sell trade and if the current price exceed yesterday and the day before highs by 5 pips the expert open a buy trade
 
Ahmed774:

I want to open an order based on the distance between yesterday low and the day before low so the idea is that when the price exceed yesterday and the day before lows by 5pips the expert open a sell trade and if the current price exceed yesterday and the day before highs by 5 pips the expert open a buy trade

When you quote somebody else's post please add your comments outside of the quote box as others may not realise that you have posted anything. I have edited your post and moved your comment.

if(currentPrice-MathMax(yesterdayHigh,dayBeforeHigh)>pips5)
  {
   //Open a trade if a trade is not already opened
  }
 
Keith Watford:

When you quote somebody else's post please add your comments outside of the quote box as others may not realise that you have posted anything. I have edited your post and moved your comment.


Thanks so much i will try it 
 
Ahmed774:


I am sorry but i do not know how to do that

 
Ahmed774: I am sorry but i do not know how to do that
Please don't add text inside quoted text or CODE blocks, put it outside.
          MQL4 forum editor problem - MQL4 and MetaTrader 4 - MQL4 programming forum
Reason: