Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1044

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 all.
My time series array is not updated in the string of trade event definition (when a new candle appears), or rather its value does not change when a new candle appears.
T[i] is first set when launching the Expert Advisor, and then, when a new candle appears, the value is updated.
The I parameter is set on the basis of the input parameters.
What is interesting, the version where I used several TFs to work, and had to use a for loop because of that, everything worked fine, but it fails here - it is not updated, and that's it...(
Hi all.
My time series array is not updated in the string of trade event definition (when a new candle appears), or rather its value does not change when a new candle appears.
T[i] is first set when launching the Expert Advisor, and then, when a new candle appears, the value is updated.
The I parameter is set on the basis of the input parameters.
What is interesting, I used several TFs to work in the version where I had to use a for loop and it worked fine, but it fails now - it just does not update...(
Apparently it wasn't pulled out of the loop correctly...
Here's a custom function for defining a new bar
Input variables:
tf - chart period or period value to determine the occurrence of a new bar.
lastbar - a variable passed by reference to store the time of the last bar.
The first time it is called from the EA, it immediately reports a new bar. Fixed by adding function calls to OnInit()
When first called from the script, it immediately reports a new bar. Then it is always false. Fixed by adding RefreshRates() to the beginning of the function
The first time it is called from the EA, it immediately reports a new bar. Fixed by adding function calls to OnInit()
When first called from the script, it immediately reports a new bar. Then it is always false. Fixed by adding RefreshRates() to the beginning of the function
1. At first call true, it is quite normal, if there have been no bars, the one that has appeared will be the new one. If necessary, if strategy demands it, it is possible to refuse from the new bar and some more in this way. At a glance, without thinking, I introduce two more.
or
2. Why would the script define a new bar? This is silly to what extent?
But why isn't it working here...((( I think it's fine(
Igemon:
Excuse me, Ygemon, but why this recklessness? What kind person advised you to do that?
What is wrong with it? I just didn't insert the rest of the code because everything is ok there. The loop is needed to not depend on ticks, when defining events, not to reboot the PC is sleep at 100mlsec
Don't OnTimer() and OnChartEvent() tell you anything?, good... sorry, Ygemon...
And how are you going to stop the loop?