comparing two values

To add comments, please log in or register
Ahmed774
41
Ahmed774  
Hello how can i use Mathmax and mathmin functions if i want to compare yesterday high and hour high

Keith Watford
Moderator
20339
Keith Watford  
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?

Ahmed774
41
Ahmed774  
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
Keith Watford
Moderator
20339
Keith Watford  
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
  }
Ahmed774
41
Ahmed774  
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
41
Ahmed774  
Ahmed774:


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

William Roeder
20207
William Roeder  
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
To add comments, please log in or register