OnTickMulti - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources

In MT5, the new tick event occurs only for the symbol on which the EA is running. Therefore, various techniques are used in multi-species trading.
The library creates a multi-symbol tick on all specified trading symbols. Convenience wrapper for older implementations .
Let's demonstrate how this library works using the example of a multi-symbol Expert Advisor that counts the number of incoming quotes for each specified symbol.
#include//Multi-symbolOnTick. integer tick counter[]; // Counter of incoming ticks for each given character. Blank initialization () { // Initialize the counter of the incoming quotes. ArrayResize (TickCounter, ArraySize (OnTickMultiObject.Symbols)); ArrayInit (tickCounter, 0 ); } double tester () { //Print the number of ticks reached for each given character. for ( unit i = array size (tick counter); ( boolean ) i - ;) Print (OnTickMultiObject.Symbols[i] + "——" + ( thin string )TicksCounter[i] + "Ticks." ); Array printing (OnTickMultiObject.Symbols); // Trading symbol list OnTickMulti. returns ( 0 ); } //Multi-symbolOnTick. blankOnTickMulti ( const &s), const your integer index (&index) { TicksCounter[index]++; // Increment the counter of incoming ticks by given symbol. }
To check the correctness of the Expert Advisor, we run it in the MT5 tester.

After the comma in the input, we set the symbol to which the multi-symbol OnTick will react.
The tester generates the following (see logs).
2023.01 . 12 23:59:59 AUDJPY - 1,618,389 ticks . 2023.01 . 12:23:59 GBP / USD - 1116822 ticks . 2023.01 . 12 23:59:59 EURUSD - 906,489 ticks . 2023.01 . 12 23:59:59 "EUR/USD" "GBP/USD" " AUDJPY" Final Balance 10000.00 Points Tester Results 0 EURUSD , M1: 906489 ticks, 12897 generated bar chart. Environment sync at 0 : 00 : 00.020 . Test passed at 0 : 00 : 01.723 (including scale preprocessing 0 : 00 : 00.188 ). EURUSD,M1: Total time from login to stop test 0 : 00 : 01.743 (including 0 : 00 : 00.248 for historical data synchronization) 3641700 total ticks for all symbols AUDJPY: 1618389 ticks generated at 0 : 00 : 00.078 , passed to tester 1618389 ticks EUR/USD: generated 906489 ticks at 0 : 00 : 00.047 , passed to tester 906489 ticks GBP/USD: generated 1116822 ticks at 0 : 00 : 00.063 , passed to tester 1116822 ticks
The highlighted section shows that all ticks generated by the tester for the specified symbol are processed by the multi-symbol OnTick.
In graphical representation, technical analysis represents the trend line (green) to the right of the breakout candle. After the breakout, assume a move along the red line.
Fox Wave Clean - Professional order manager and professional EA, achieving efficient transaction management through one-click position control. Simple design, powerful functions.
As an MQL5 programmer, ensuring the security of data transmission between client and server can be a huge challenge. You may have experience using built-in MQL5 encryption systems such as AES. AES can securely encrypt your data, but on the other hand, the AES key is not secure when it is sent over an unsecured channel. In this case, you can only rely on asymmetric encryption systems such as RSA. You keep the private key on the server side and only share the public key with the client. You can even use a hybrid RSA_AES approach to improve performance
For BBMA Oma Ally fans, this is like a bird's eye view. Just drag it onto the chart and you will see all the BBMA signals running on the chart.
Attachment download
📎 spy.mq5 (0.83 KB)
📎ontickmulti.mqh (11.77 KB)
📎ontickmulti_example.mq5 (1.64 KB)
Source: MQL5 #47647
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •