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
That's what I'm saying!
And you say 'no one has seen'. No one is interested - so no one has seen it (clowns are not interested - they haven't seen it). Those who are interested - they have seen.
Sent a complaint to the moderators about the clown, and will do so until you get banned
Oh, scared the hedgehog with his bare ass...
Oh, scared the hedgehog with his bare ass...
I don't see the problem.
Right. A filled array is declared, and then - it is filled again, with other data. In my opinion, it's quite an acceptable error for a beginner.
And is it an error?
When I'm declaring variables and arrays, I MUST FILL them IMMEDIATELY. If at the moment of declaration the exact value is unknown, I fill it with knowingly invalid value. If a variable is declared without initialization and then used, it can contain random values, which will be used during work, and the result of this work will be incorrect and it will be very difficult to find the problem (I've found it more than once).
But if a variable is initialized with invalid value right at creation, in case of using uninitialized variable it will be immediately found out that it contains some rubbish, it will be easy to find where it came from and see that the variable was used without initialization.
So personally, I think that declaring an array already populated is good practice. But we should take WRONG_VALUE values there.
I'm not against initializing variables and even arrays at all. For example, like this
will also be an initialized array. But even this in this case is not necessary because the entire array is filled in OnInit(). So I do not see any need in it. And even Pinocchio with his apples does not work here, because before using (reading) values, they will already be initialized.
I'm not at all against initialising variables and even arrays. For example, like this
will also be an initialized array. But even this in this particular case is not necessary, because in OnInit() the entire array is filled. So I do not see any need in it. And even Pinocchio with his apples won't work here, because before using (reading) values, they will already be initialized.
Eh... And where will it be "initialized"? By code, such an array will be filled with rubbish.
In my opinion, it's good practice to initialize with non-invalid values at creation, as I've already said:
Of course, if array is big - it's unreasonable to fill it by such method, in this case I use DEBUG-version, in which I fill even big array with non-invalid values, while in RELEASE-version there is no filling.
This practice has repeatedly saved me from using uninitialized variables.
Your name in the code - the code you set up I created under your name to know. But it didn't work.
Well, who's to blame for your bad hands?
On the image you can see that the calculated value is 9.08253 and after conversion 9.08 and do not tell me about 1 in 16 decimal places.
And also, if you get a value less than the minimum volume
I had to enter another variable to show...
Erm... And where would it be "initialized"? By code, such an array would be full of rubbish.
In my opinion, it's good practice to initialize at creation with invalid values, as I've already said:
Of course, if array is big - it's unreasonable to fill it by such method, in this case I use DEBUG-version, in which I fill even big array with non-invalid values, while in RELEASE-version there is no filling.
This practice has repeatedly saved me from using uninitialized variables.
Right here, in the highlighted loop. And note the fact that I was only talking about one array.
Forum on trading, automated trading systems and strategy testing
Self-study in MQL5 from scratch
SanAlex, 2021.11.29 07:17
i can't understand what you're talking about. i did it with my own hands. what do you mean? the code is from the terminal, but the way itself, how to implement opening a few pairs in the tester, i personally achieved the result.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Show me where I took the code from you.
I've removed everything from the code that doesn't concern our dialogue. Well, almost everything...
Right there, in the highlighted loop. And note the fact that I was only talking about one array.
Yes, that's right. In my opinion, normal practice.
This one is almost ready - I just need to remove unnecessary non-functional functions. This multicurrency Expert Advisor is from this "MACD Sample.mq5"
I seem to have removed all unnecessary things for it to work. I have to polish it to the taste and then I will post it here.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
This is what I have got so far - maybe someone will do it better
I really hope you didn't write this...
Here's a working function
All you have to do is enter the risk size to count not from the full free margin...
Good day and good mood everyone!
It took me a long time to understand and examine arrays, but I already have the result, because I wrote the code of function that calculates the risk for 12 currency pairs by myself.
Regards, Vladimir.