Creating multiple numbered variables and storing in arrays.

 


Lets say you have an array  that stores 100 lot values .
And you have 100 inputs of different lots.

You have to create 100 inputs  

input Lot1;
input Lot2;

.

.

input Lot100;

and then have to store them in the array

LotsArray[0]=Lot1;

LotsArray[1]=Lot2;

.

.
LotsArray[99]=Lot100;



I would do this manually  or type in another programming language  a loop to produce me the relevant text and copy-paste it in Mql5.
Does anyone have a better method for this?
 

 

Create one input like a string being separated by delimiter character. Parse the input string using StringSplit.

input string lots_str="1,2,3,4";
string lots_array[];
double lots[];

StringSplit(lots_str, ',', lots_array);
for(int i=0;i<ArraySize(lots_array);i++)
{
   lots.Push(StringToDouble(lots_array[i]));   
}

I did not compile or test it.