Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1424

 
ANDREY:

QUESTION
How and what values should I enter inArrayFill() if I need to fill the yellow elements of the same array with value 12?

Thanks for your help

The array fill function is designed to make things easier. So that you can get rid of loops. And your example is easier to fill in like this:

LoY[1][0] = 12;
LoY[1][2] = 12;
LoY[2][1] = 12;
 
Alexey Viktorov:

The array filling function is designed to make work easier. So that you can get rid of loops. And your example is easier to fill like this:

That is, ArrayFill() fills the array values that go in a row after the array is represented as one-dimensional. And it doesn't fill the array values that are NOT in a row?

 
ANDREY:

So ArrayFill() fills in array values that are consecutive after the array has been represented as a one-dimensional array. And doesn't fill array values which are NOT in a row?

It will. But why scratch your left ear with the little finger of your right foot?

Put an appropriate index to start with, number 1 and value to fill.

And so for each item that needs to be filled in.
 
Alexey Viktorov:

But why scratch your left ear with your right little finger?

Put the appropriate index to start with, the number 1 and the value to fill in.

And so for each item that needs to be filled in.

It all depends on concrete situation and concrete circumstances, which may occur so that there will be no other choice but to scratch the left ear with right little finger.

For this variant the function will look like this ?ArrayFill( LoY, 3, 1,5.1,7,1, 12 )? Or is the punctuation different?
Thank you.

 
ANDREY:

It all depends on the specific situation and the specific circumstances, which may be such that there is no other option than to scratch the left ear with the little finger of the right foot.

For this variant the function will look like this ?ArrayFill( LoY, 3, 1,5.1,7,1, 12 )? Or is the punctuation different?
Thank you.

//--- заполняем начальные 5 элементов значением 123
   ArrayFill(a,0,5,123);
//--- заполняем 5 элементов (начиная с 5-го) значением 456
   ArrayFill(a,5,5,456);
 
Vitaly Muzichenko:

Thank you for the information. But I already understood what you wrote. You use the ArrayFill( ) function to fill in the elements of the array with values going in a row
In the first example, from zero to the fifth element. In the second example, from the fifth to the tenth.
I want to understand how to write the function to fill array elements which are not in a row. The yellow cells in my last post are the array elements to be filled with value 12 in . ArrayFill( )

Thanks for your help.

 
Colleagues, please help, I haven't checked it myself, I realise it's elementary, maybe it's different for different brokers, I mean forex: if you partially close a position, does its ticket change or not?
 
Roman Shiredchenko:
Colleagues, please help, myself have not checked, I understand that it is elementary, perhaps different brokers differently, I'm talking about forex: if I partially close a position, its ticket changes or not?

Change.

The commentary of both positions is spelled out:

The one that was partly closed: "To #ticket_new"

In the one that remains: "From #ticket_parent"

 
Artyom Trishkin:

Change.

The commentary of both positions is spelled out:

The one that was partly closed: "To #ticket_new"

The one that is left: "From #ticket_parent".

Senks. Maybe you can advise me on the optimal closing algorithm based on the opening price and the Expert Advisor's ticket for the position. For example, we have a 10 lot position and we need to close it by 4, 3 and 3 lots. What is the best way to do it?
If without magic....
Instead of using magic check for presence of position at a specified and known open price? After all, it doesn't change like a ticket at partial closing... as an option, is it also possible?
 
Artyom Trishkin:

In the one that was partially closed: "To #ticket_new"

In the one that remains: "From #ticket_parent".

The comment format may vary from broker to broker.