Writing to the file on a new line - page 5

 
Aleksei Stepanenko:

Let me try again to convey the idea of the usability of an array

I've already written how to save this array.

Or parse your string.

But you can't use the StringSplit function to switch from a string to an array?

 
So you need to get several variables of different types. Why not switch your attention to another option?
 
EfremovSergey:

Can you use the StringSplit function to switch from a string to an array?

Yes, you can, if you put an explicit conversion to double before the price, for example

 

EURUSD,5,0.02,1.17808,70,0,0,302090516

What type of array do I need to get?

 
Aleksei Stepanenko:
EURUSD,5,0.02,1.17808,70,0,0,302090516

This string will be converted to a string array, e.g. string arr[];

OrderSend(arr[0], (int)arr[1], (double)arr[2], (double)arr[3], (double)arr[4], (double)arr[5], (int)arr[6]);
 

The good thing about a programming language is that there are several ways of doing things. Our task is to choose the more elegant one.

Aren't these crutches? Including my option.

 
Aleksei Stepanenko:

EURUSD,5,0.02,1.17808,70,0,0,302090516

What type of array do you want to get?

I agree with you. The array seems to be of the same type. Although, on the other hand, substrings obviously contain different types of data, for example EURUSD cannot take an intrinsic value in any way.

 
Alexey Viktorov:

This string will be converted to a string array, e.g. string arr[];

Thank you very much, that calms me down, I was beginning to have doubts.

 
Aleksei Stepanenko:

The good thing about a programming language is that there are several ways of doing things. Our task is to choose the more elegant one.

Aren't these crutches? Including my version.

Why are they crutches? You may get a string, convert it to a certain type and insert it wherever you need. However, I think the array in your version is excessive. The structure will suffice. After all, it is a string that is read, not several strings.

 
Sergei has multiple EAs working there, multiple rows, so it's an array. And that's why everything looks ugly. Maxim Kuznetsov suggested SQL, this is the right way for these EAs to communicate with each other.