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,
The problem bug lies in the Print function; i replaced print with Alert and it is working as expected. By the way, global variables are static by themselves
(in MQL that is) so there is no need to do
static datetime newbar ;
best regards
I will Try
Thank you
Well, i was hurry on that one; Alert looks like it is working, but it does not actually
Yes, I have try and still hang
basicly, I want to loop the program until new candle occurs (do not go to the bigining start program for every tick until the current candle finish)
Do you have suggestion beside "While(still old candle)"
Thank you
Demos:
Yes, I have try and still hang
I looked at a little bit more, and here are some remarks. You can try the code
If you right click and remove the script before it finishes the counting, we can see that the terminal disregards Sleep() and proceeds to complete the script as if Sleep was not there. So, in case we have while (newbar==Time[0] ) it goes in an infinite loop. Looks like a bug to me
Also, you should add RefresRates() inside while, or else Time[0] is not updated (so above code is wrong as well :) )
basicly, I want to loop the program until new candle occurs (do not go to the bigining start program for every tick until the current candle finish)
Do you have suggestion beside "While(still old candle)"
I have add RefreshRates(), but the problem still exist
what do i don't understand why there isn't any "Still Old candle" printed in the expert tab, not even once
thank you
I think the structure of my program is wrong, because even I use this still the problem occurs
anyway thank you for to all of you for your effort to help me
best regards
I have add RefreshRates(), but the problem still exist
what do i don't understand why there isn't any "Still Old candle" printed in the expert tab, not even once
thank you
I put your code into a script and it worked as expected. Printed every second until a new bar.
Are you sure that you are looking in the Experts Tab and not the journal for the prints?
I put your code into a script and it worked as expected. Printed every second until a new bar.
Are you sure that you are looking in the Experts Tab and not the journal for the prints?