MT4. How to make a graphical object appear after a certain a period of time at the right coordinates relatitve to price and time?
tseby: I'm creating a simple indicator … and then another arrow JUST AFTER A COUPLE OF MINUTES
- Indicators can not sleep.
- Remember the current datetime. When a new tick arrives, and it is two minutes since, draw the new arrow.
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
Hello everyone.
I'm creating a simple indicator that draws an arrow when the price hits upper or lower Bollinger Band and then another arrow JUST AFTER A COUPLE OF MINUTES (let it be 2 mintes) at the current Time and Price coordinates.
Right now I'm trying to make it work with EA template with 1 include file through Sleep() function (idicator template does not pay attention to Sleep() (or it does but i cant get it yet))
Code of <include.mqh>:
Code of the EA:
The PROBLEM is that the second arrow is appearing at the right time but the price is wrong.It stays the same as the first arrow.(screenshot)
At first I thought that once the functions are executed they remember the bid price at the time of execution and just used them.
So I declated a new vairable that is expected to take the newest Bid price (which is updated every tick) and pass it into the second arrow function.
But for some reason it just wont budge.
I tried tinkering with creating arrows in different functions but that didnt work.
I tied to put the Ask price for the second arrow and it did in fact changed the price position but relative to the Ask OF THE FIRST ARROW. Not the current one.
I'm sure it has the simplest solution but i dont see it