Download MetaTrader 5

Send notice of opportunity to open position

To add comments, please log in or register
Ivan9215
62
Ivan9215  
Hi, how are you. I have a problem with a code that, under certain conditions, must determine if it is favorable to open a purchase or sale position, but only send the notice.

I try to put an Alert ("There is an opportunity to buy or sell according to the case"). But the alert appears every time the price changes and it does not according to the conditions that I put in order to know if it is convenient to place an order.

Is there any other way that sends notices? Or am I doing wrong?
Fernando Carreiro
3952
Fernando Carreiro  
Ivan9215:
Hi, how are you. I have a problem with a code that, under certain conditions, must determine if it is favorable to open a purchase or sale position, but only send the notice.

I try to put an Alert ("There is an opportunity to buy or sell according to the case"). But the alert appears every time the price changes and it does not according to the conditions that I put in order to know if it is convenient to place an order.

Is there any other way that sends notices? Or am I doing wrong?

If you want help, you will need to show your code in respect to the problem you face.

Also, even without seeing your code, you are most probably checking for the condition on every Tick event, when you probably should only do it on every new bar instead.

If that is the case, then change your code to only detect and send the alert only on a new bar and not on every tick.

To add comments, please log in or register