[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 14

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
the function itself will stop working, if there is a requote by the else condition
try = 0, so the while loop will stop and openOrder() returns false
But if we use the while(!openOrder(...)){} construct, then it will continue chugging until it opens an order
Since you have written that the order should open, I have given such a "rigid" construction, if it should open, it will open regardless of how many attempts it takes... If we open orders normally, then while is not needed, we can pass the number of attempts in try and in the function already determine whether to react to critical errors or ignore them and just try to open the order try once...
The point of while(!openOrder(...)){} is that we create an eternal loop, i.e., it will work until the order is opened.
Actually, define what tactics should be used when opening orders, we will help...
Here's the question:
I can't work with an array.
I initialise the array, fill it with any data, but when I read it, there are zeros.
What am I doing wrong?
I can't work with an array.
You have to specify the size of the array, e.g. when declaring it:
Or then:
What if I don't know what size my array will be?
And even if I do, it doesn't compile:
I insert an external variable:
And the rest of the text:
The output is:
'Razmer' - integer number expected C:\Program Files\MetaTrader - Alpari2\experts\temp.mq4 (36, 16)
']' - comma or semicolon expected C:\Program Files\MetaTrader - Alpari2\experts\temp.mq4 (36, 22)
'MASS' - variable not defined C:\Program Files\MetaTrader - Alpari2\experts\temp.mq4 (40, 3)
'MASS' - variable not defined C:\Program Files\MetaTrader - Alpari2\experts\temp.mq4 (44, 9)
What if I don't know what size my array will be?
So, you have to use the ArrayResize function when you know how many elements will be in the array.
With an external variable, as you can see, it won't work:)
You may do it this way:
Thank you, dear Surgeon.
It's working :)
What exactly are you trying to achieve?