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
You are (likely) looking at a signal. Act on a change of signal.
Too many orders - MQL4 programming forum #1 (2017)
I guess there are a few different ways to approach this.
I should be more clear about what my goal is at this point - I want the alert to play for the first second of the bar. I don't mind if the alert plays on every new minute that elapses. I just don't want it to play in an annoying irregular way.
I'm using Dominiks logic now:
although I'm noticing very different behavior if I do:
if (last_playsound_time < time[i]){
instead of this:
if (last_playsound_time <= time[i]){
or this:
if (last_playsound_time == time[i]){
something weird is going on, but I'm going to try to get this working with the time buffer
I guess there are a few different ways to approach this.
I should be more clear about what my goal is at this point - I want the alert to play for the first second of the bar. I don't mind if the alert plays on every new minute that elapses. I just don't want it to play in an annoying irregular way.
I'm using Dominiks logic now:
although I'm noticing very different behavior if I do:
instead of this:
or this:
something weird is going on, but I'm going to try to get this working with the time buffer
ok, I was thinking about it another way. but I understand now. It is actually working now ,small change:
first takes away the remainder of seconds and then adds another period of 60 seconds to make the variable point to the next minute (it would work for optimization)
I will go with this as it seems to play the alert sound gracefully (and once) without any strange stuff going on. Great
ok, I was thinking about it another way. but I understand now. It is actually working now ,small change:
first takes away the remainder of seconds and then adds another period of 60 seconds to make the variable point to the next minute (it would work for optimization)
I will go with this as it seems to play the alert sound gracefully (and once) without any strange stuff going on. Great
I can try without the addition of final 60 seconds again. I wasn't sure if it worked the other way but it it could have been something I did wrong. I don't mind to add another minute to force it to be true
Just for posterity, it does indeed work fine like so:
Just for posterity, it does indeed work fine like so:
I was thinking though there might be (on rare occasion) no audio signal if the time of alert happens to occur on the 0 second for example 13:22:00, because then last_playsound_time < time[i] would not be satisfied (as it would be equal on such an occasion), although I guess it's rare to have an alert occur on the zero second