Remember that, although the instance_bit variable has 64 bits, only 53 bits can actually be used due to the conversion to the double type when assigning to the global variable. Therefore, the maximum number of instances that can be managed through a global variable, which is of the double type in MQL5, is 53.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Uses 1 temporary GV and bitwise operators.
Uses 1 temporary GV and bitwise operators.
Nice variation on the bitwise methodology. Slightly quicker too, I imagine
Using the previous ideas, I implemented the two functions below with some modifications to the code in MQL5:
Here is an example of how to use these functions to create a unique ID in the name of an indicator:
Complement to: https://www.mql5.com/en/forum/191997/page3#comment_54114970
Remember that, although the instance_bit variable has 64 bits, only 53 bits can actually be used due to the conversion to the double type when assigning to the global variable. Therefore, the maximum number of instances that can be managed through a global variable, which is of the double type in MQL5, is 53.