Your code | if (Bid == val) PlaySound(AlertWav);{ PlaySound(AlertWav); SendMail("TLine Alert","T Line Alert Pip Range"); SendNotification("T LIne Alert Pip Range"); } |
Same as | if (Bid == val) PlaySound(AlertWav); { PlaySound(AlertWav); SendMail("TLine Alert","T Line Alert Pip Range"); SendNotification("T LIne Alert Pip Range"); } |
Same as | if (Bid == val) PlaySound(AlertWav); PlaySound(AlertWav); SendMail("TLine Alert","T Line Alert Pip Range"); SendNotification("T LIne Alert Pip Range"); |
Of course it does.
Your code | |
Same as | |
Same as |
........ . . ..............................................................................................................................................................................
thnx for ur replay
I don't understand what you mean exactly in the 3 cases with changing the braces {} but i guess you mean the equation should be some thing like
double val=ObjectGetValueByShift(TLineName, 0); if (Bid-AlertPipRange*Point <= val && Bid+AlertPipRange*Point >= val) PlaySound(AlertWav);{ PlaySound(AlertWav); SendMail("TLine Alert","T Line Alert Pip Range"); SendNotification("T LIne Alert Pip Range"); }
am I right or not??
thanks again
Not. Your problem is the braces are not part of the IF.
I'm sorry mr.William, I have tried many ways but I can't find any soution :( .. even this
double val=ObjectGetValueByShift(TLineName, 0); if (Bid== val) { PlaySound(AlertWav); SendMail("TLine Alert","T Line Alert Pip Range"); SendNotification("T LIne Alert Pip Range"); }
You're almost there. Presumably with the last code you are not getting any alerts at all, rather than every tick?
If that is the case then you should mention this when reporting back, so that people know that your issue has changed then check the previously posted advice below:
There is a lot to read, you have to use a tolerance when comparing doubles ( Bid with val ) ....
You're almost there. Presumably with the last code you are not getting any alerts at all, rather than every tick?
If that is the case then you should mention this when reporting back, so that people know that your issue has changed then check the previously posted advice below:
There is a lot to read, you have to use a tolerance when comparing doubles ( Bid with val ) ....
thank you
I think that every thing before and after (Bid== val) is true, but (Bid== val) itself is impossible !
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hello every one
is there any way to edit this trend line by angle to give its alert ONLY when the Bid price equals its corresponding point on the line, as it givs an alert with every price tick even if it's far away from the line.
thanks in advanse