trichman, comparing two values is done using '=='.
When '=' is used, you're telling the program to change the value of the variable to a new one.
So your code should look like this:
if(P == bid)
{
SendMail("MT4 Alert", "Price has reached Pivot Point");
}
wow its a programiing how i can start this i m also php mysql programmer can i know thais
yes boom ur right
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
not sure how to write an if statement when I want to have two variables equal each other.
...if(P = bid)
{
SendMail("MT4 Alert", "Price has reached Pivot Point");
}
P is a calculated value which works fine, Bid is the current bid price.
However this does not work giving me
'=' - illegal assignment used C:\Program Files\Interbank FX Trader 4\experts\indicators\Pivots_Daily EMAIL1.mq4 (391, 12)
'Bid' - unexpected token C:\Program Files\Interbank FX Trader 4\experts\indicators\Pivots_Daily EMAIL1.mq4 (391, 14)
')' - assignment expected C:\Program Files\Interbank FX Trader 4\experts\indicators\Pivots_Daily EMAIL1.mq4 (391, 17)
Thanks in advanced for your help.