Sorry for the confusion.
I need to set 3 'EventSetMillisecondTimer' like below (you said it does not work...). Is there available alternative way, please?
The timer is set only once in the OnInit() function.
If you want to reinitialize you have to kill the old timer first this usually happens on OnDeinit() function.
Like i said alternatively you could use a counter.
If you put code in for example a 10 Millisecond timer then the code will be executed every 10 Milliseconds.
This will most likely freeze your terminal because it is too fast.
Note that the one minute is only triggered once, so not every minute.
The 5 minutes will trigger also only once after the first five minutes, so not at the ten and not at the 15 min mark.
If you want for example to trigger on every minute you have to add code for 60 sec for 120 sec for 180 sec and etc.
The 15 minutes mark will trigger every 15 min because it sets the counter to zero.
What mechanism do you want to use, what code do you want to trigger on the timed intervals?
Good one Marco.
You could do something like this to trigger at every time interval
Marco vd Heijden:
Once again excellent comment, big thanks man.
...my indicator works which was (/ is) I wanted (/ want).
Indicator works like this:
I need to describe my concern with example:
I open EURUSD chart and attached my indicator to the chart, and works perfect which is like I want, moves / shows forward (even past) VLINE's, I can change TIMEFRAME PERIOD and automatically intervals adapted that PERIODs (which is I want).
Where is my indicator problem? // maybe it is not a problem but it takes a little a bit more 'irrelevant' times to update.
If I choice 'EventSetMillisecondTimer( 10 );' and then I change TIMEFRAME PERIODs to any TIMEFRAME PERIODs and almost I do not see (when that) loads new VLINE's to the chart (which one I want)
Much and much more appreciate yours comments - Marco & whroeder1
(NOTE: I do not use 'switch operator' - because your #18 comment better then everything which is I upgrade it and working on it - and it is very useful for me)
(English is not my native language)
Also nice one Keith. :)
Really that help me a lot, I will use it in my next indicator.
All the best.
I don't knpw about anyone else, but I find your mix of font, colours, bold and italic etc distracting and annoying. In fact I couldn't be bothered to read this post.
Well if it is about switching timeframes then the timer is not a good option because the timer get's destroyed upon switching frame.
You can create your lines in the OnInit() function, and update them in either the OnTick() or OnTimer() functions.
Here's an example:
And additionally if you want to update the lines whenever a new candle arises you can combine the example on previous page with the last one to give you this: