[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 423

 

Reshetov:спасибо
извиняюсь за то что не в SRC

how to insert it here

 
7777877:

Did I understand you correctly? You should think of the deinit function (and the loop in particular) as follows:


Correct, in this case removing for example 18 object, 19 becomes its place, 19=>18 i.e. one reverse iteration is automatically obtained. Use this for orders too.

Also, since the list of objects and orders are formally arrays starting from = 0, the maximal index will be one less than the array size:

int Quant_Objects=ObjectsTotal()-1;
 
 
pako:

Thanks, but that's not the point. I wrote "How can I fix the code (without changing the magic) so that the block produces results for each currency pair?"

 
thanks again.
Files:
 
in this indicator to redo
 
Reshetov:

Change:

To:


Thank you, but this is not the right one. In your case all currency pairs will be calculated and you need the block to give results for each currency pair.
 
abeiks:

Thanks, but that's not the point. I wrote "How do I fix the code (without changing magic) so that the block produces a result for each currency pair?"

if you have two or three pairs, just add for each pair if(OrderSymbol() == "EURUSD") countEURUSD++; etc.

if all instruments, then put them into the matrix

 
abeiks:

Thank you, but that's not what you need. In your case all currency pairs will be calculated and you need the block to give you results for each currency pair.

Then you have to first take data for all orders, and then, calculate the number of currency pairs, divide one array into several (each for its own currency pair), and read the data separately.
 
pako:

if two to three pairs, just add for each pair if(OrderSymbol() == "EURUSD") countEURUSD++; etc.

if all of the instruments, then enter it in the matrix


Thank you.

Reason: