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
This variant of the function has no New_bar() function at all;
This is the most resource-saving option I've provided. In addition, it has another advantage: The new bar event is saved all the time the user code is executed on a timer or tick event.
Previously, you could only get this event once and the flag was cleared with New_bar(). The special function now clears the "event_new_bar[][]" array once a minute and is called only after the execution of custom code.
Custom functions can directly access the array and retrieve new bar event information all the time the code is executed on a timer or tick event.
This saves resources even more.
The last code also doesn't work, it took 7 minutes for the print to arrive
The last code also doesn't work, it took 7 minutes for the print to arrive.
This function should be called from OnTick or from a timer.
There might be a small problem, but I haven't been able to locate it yet. Have a look at the code yourself and look for an error. It is as simple as a 3 kopecks. And with comments too.
If you don't understand it, ask. I have other things to do.
This variant of the function has no New_bar() function at all;
This is the most resource-saving option I've provided. In addition, it has another advantage: The new bar event is saved all the time the user code is executed on a timer or tick event.
Previously, you could only get this event once and the flag was cleared with New_bar(). The special function now clears the "event_new_bar[][]" array once a minute and is called only after the execution of custom code.
Custom functions can directly access the array and retrieve new bar event information all the time the code is executed on a timer or tick event.
Resources are saved even more.
I don't understand the humour. Why - the debugger does not understand Russian? Or it's just me who has such a glitch? Sees variables in Latin, but not in Cyrillic.
Peter, then how do you use the debugger, or don't you use it?
Anyone interested can look for a bug in the code.
The gist of the code:
1. Declare global arrays:
2. On initialization, set the size of the array of symbols and write there the names of symbols from the market review.
3. Set the size of the first dimension of the "Number_bars[][]" array which equals to the number of symbols, and the second dimension equals the number of timeframes. This array is like a table. It will record the current number of bars of each symbol and each timeframe. The number is returned by the iBars function.
4. Set the size of the first dimension of "Events_new_bar[][]" array, which is equal to the number of symbols, and the second dimension equals the number of timeframes. This array is like a table. It will record the event flags of new bars of each symbol on each timeframe.
5. Inside the timer, we count down the minute and do a double (nested) loop on the symbols (which are in the array Symbols[]) and timeframes (which are in the array Timframes[]). We call the iBars function and get the current number of bars of each symbol and each timeframe from the Symbols and Timeframe arrays. First, we compare the current number of bars with the number already stored in the array. If these values are not equal, we set the flag of the new bar event in the "Event_new_bar[][]" array. We then write the current number of bars in place of the previous one.
The global array "events_new_bar[][]" is available at any point in the program and is automatically filled every minute, and also automatically cleared. During the period when the array is being filled, the user functionality receives fresh data about new bars. The array is then automatically cleared.
That's it.
This function should be called from OnTick or from a timer.
There might be some small problem, but I haven't been able to localise it yet. Have a look at the code yourself and look for an error. It is as simple as a 3 kopecks. And with comments on top of that.
If you don't understand it, just ask. I have other things to do.
professional answer
I don't understand the humour. What - the debugger doesn't understand Russian? Or is it just me who has such a glitch? It sees variables in Latin, but not in Cyrillic.
Peter, then how do you use the debugger, or you do not use it?
professional response
This function should be called from OnTick or from a timer.
There might be some small problem, but I haven't been able to localise it yet. Have a look at the code yourself and look for an error. It is as simple as a 3 kopecks. And with comments too.
If you don't understand, just ask. I've got other things to do.
It is so complex and twisted that you cannot make it out.
I'm sorry, but it's also completely unreadable.
It's so complicated and twisted that it's a mess.
I'm sorry, but it's also completely unreadable.
You know what they say about "you can't... don't torture..."? I think it's a good one.
You know the saying about "you can't... don't torture..."? I think it's a good one.
That's right, that's how you got on with the task conclusively, well, or I failed to get your solution right.