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
Peter, it's not working for me either.
Your programming style is strange. You may put all this stuff with all variables and loops from OnInit and OnTimer into one procedure. If someone wants to use it, because this code will get in the way. What if we have 20 or more procedures with the same contents? After all, it is implementedhere .
Peter is not looking for an easy way out...
There is also a problem with the start time. Something does not register the start of the bar at the right time. I will figure it out later.
The start of the bar is not always precisely timed.
Sometimes bars are skipped altogether.Peter, it doesn't work for me either.
Your programming style is strange. You can put all these things with all variables and loops from OnInit and OnTimer into one procedure. If someone wants to use it, because this package will get in the way. What if there will be 20 or more procedures with the same contents? After all, this iswhere it's implemented.
On a minute it works, but it does not lock the beginning of the bar at the right time.
I haven't checked it on other timeframes, because it takes a long time to wait.
As for style, it doesn't matter now. We can take everything out of the timer and put it into a separate function. I was just thinking about the solution itself, not about future variants of its integration.
The start of the bar is not always exactly on time.
I was thinking that if a person really has 600 instruments in the market overview and on every tick he checks the arrival of a new bar for each instrument and each timeframe, it may be expensive...
I myself don't trade, so I don't know exactly how many times this function should be called in practice.
The double loop on symbols and timeframes in the new bar function may increase the load only if the number of symbols and timeframes is very large and the function is called on each tick of hundreds of symbols. Perhaps Dmitry is right then.
I have shortened one loop in the function.
Just forget about it.
Here is an example of my class specifically for this action. Of course, it is not a masterpiece, but it is mine, and it understands me and works.
If you want to determine only on the current TF, you have to call function without parameters.
Accordingly, if it is placed in .mqh, the library must be attached.
#include <путь_папка\имя_файла.mqh> CNewBar newBar;
and it is called in OnTick().
If we need to define other TFs, we declare variables for each period and symbol, if necessary, at the level of global variables or static ones.
This approach is effective when working on the TF other than the required one and protects from problems with accidental switching of the chart on which the Expert Advisor works.
Peter, it doesn't work for me either. Although the algorithm is quite fast, it's a waste of time. But it's not working yet. No time to figure it out.
You have a strange programming style. You may put all this stuff with all variables and loops from OnInit and OnTimer into one procedure. If someone wants to use it, all this stuff will get in the way. What if there will be 20 or more procedures with the same contents? It is implementedhere .
Maybe you don't know what 'fast' means?
Oh, spit it out...
Here's an example of my class specifically for this action. Of course, it's not a masterpiece, but it's mine and it works for me.
If you want to determine only on current TF, then function without parameters is called.
Accordingly, if it is placed in .mqh, the library must be connected.
and it is called in OnTick().
If I want to determine other TFs, then at the level of global variables or static ones, variables are declared for each period and symbol, if necessary.
This approach is effective when working on the TF other than the required one and protects from problems related to accidental switching of the chart on which the Expert Advisor operates.
You have no idea what idiocy you demonstrated, it's just absurd. But I will not show you exactly in what place, because you all are not interested in my opinion)))
Oh, spit it out...
Here's an example of my class specifically for this action. Of course, it's not a masterpiece, but it's mine and it works for me.
If you want to determine only on current TF, then function without parameters is called.
Accordingly, if it is placed in .mqh, the library must be attached.
and it is called in OnTick().
If it is necessary to determine other TFs, then at the level of global variables or static variables are declared for each period and, if necessary, for the symbol.
This approach is effective when working on the TF other than the desired one and protects from problems with accidental switching of the chart on which the Expert Advisor works.
Regards.
Oh, spit it out...
Here's an example of my class specifically for this action. Of course, it's not a masterpiece, but it's mine and it works for me.
If you want to determine only on current TF, then function without parameters is called.
Accordingly, if this is placed in .mqh then the library should be included
and it is called in OnTick().
If I want to determine other timeframes, then at the level of global variables or static variables are declared for each period and symbol, if necessary.
This approach is effective when working on the TF other than the desired one and protects from the problems with accidental switching of the chart on which the Expert Advisor works.
Does your solution work well? If well, then everything is fine.
How about the case of hundreds of instruments - won't there be any overlap?