[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 176

 

Please explain the difference between these two variable definitions (at the beginning, before init()):

double x1[];

и

double x1[100000];

Thank you!

 
chief2000 >> :

Please explain the difference between these two variable definitions (at the beginning, before init()):

и

Thank you!





double x1[100000];

is a declaration of an array of 100000 elements

double x1[];

is to commit an array with an unspecified number of elements, which is then set in init

 
evgenio >> :

double x1[100000];

is a declaration of an array of 100000 elements

double x1[];

The default value is to bind an array with an unspecified number of elements, which is then defined in init.

I want to clarify a question - when I set an array like "[]" (without specifying the number of elements),

and then tried to make any operations with the array, the Indicators simply didn't work. Then it became

"automatic" - if Indicator contains arrays and doesn't work (zero values) =>

it's necessary to add a number to array definition, for example 100000, and this problem disappeared.

Is this how it should be?

 

Thank you

 
chief2000 >> :

>> Is that how it should be?

Yes, except for indicator arrays which do not require dimensioning.

 
Please advise how to correctly determine the maximum loss-making lot at the moment of closing a profitable SL, if there are any at the moment, and combine their closing even possible in the loss of their total balance. I want to prevent losing lots this way. I hope to avoid the total drawdown, because the total number of profitable lots exceeds the number of losing ones. Maybe someone will be able to insert this function into an EA at the moment of closing a bunch of orders. Thanks
Files:
yurik_2_1.mq4  11 kb
 
Hi all !!! I would be thankful for an EA that will place pending buy stop orders 10 pips above yesterday's high and sell stop orders 10 pips below yesterday's low at the same time. Parameters that I would like it to change: Take Profit, Trailing Stop, Stop Loss, and the number of points opening orders from yesterday's high and low. Thanks in advance.
 
Synax >> :

..The only "BUT" in the tester to check the work of the indicator does not work, for some reason it does not change in the properties of the horizontal lines, prescribed in the description of Buy and Sell. I have to wait for Monday, when the bidding starts.

Why? Try it in visual mode. (Check the box in Visualization)

It seems to change the properties of the lines.

 
granit77 >> :

Yes, except for indicator arrays, which don't need to specify the dimensionality.

As far as I understand, you can set 100000 in all cases to be sure?

 
chief2000 писал(а) >>

As far as I understand, you can set 100000 in all cases to be sure?

You have to set as many as you need... ...so that you can loop it... if you have to...

Reason: