MT5 Indicator problem : How to only call Telgram message sending function on detecting latest condition only (Also not while getting tested in strategy tester)?
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
Hi everyone,
I have built an indicator in MT5 (MQL5) which detects a condition and draws it out on chart for me to take a trade manually. I am planning to write a telegram message sending function too, which is supposed to send a message to telegram (to me) on detecting that condition (which i will use to potentially take a trade). However I am unsure how to call that function via the indicator while making sure it only sends the message for condition just detected on LIVE chart only and not for historically detected conditions. My code is below :
What i want is for this indicator to only send a telegram message when it has detected a newly developed condition on Live chart. It should not send telegram message for the previously occured conditions in the chart. This is so that I will not be flooded with messages on Telegram about historical conditions which i will not take any action on.
Also I don't want to be sent a message on testing this indicator in strategy tester.
In the above code I thought of using :
statement for this purpose, but i am inexperienced, so I am not sure if this is the correct way. There may be a better way of doing this that i am not aware of.
Also, I don't want it to be triggered by strategy tester but not sure how to enforce that in code.
Can anyone provide any guidance.
Much appreciated!