String variable adjustment using "Modify Variables" block?
-
Hi,
So I have this string variable with value: 1,2,3,4,5EA executes one value from the string at a time, if it loses, it moves on to the next value.
I want to reuse the first value when a loss is triggered, or in other words - to Not proceed to the next value in that sequence.
Is it possible to do with the "Modify Variables" block? (I know that you can make simple adjustments using the "adjust" window, but there is no instructions on how to move one value back in the string sequence):

-
@fxdreema Would appreciate your input on this.
-
It also seems like you can't have multiple values in the "Modify Variables" Numeric input:

-
I'm not an expert at mql4, but I would say that string variables cannot be numbers, but text. According to your example, you want to modify numbers so you should use a 'double' or 'int' variable instead.
-
@l-andorrà String datatype is used for characters such as a b c, blanks and other special character and also numbers. However the values as numbers are not numbers to calculate with such as multiplication.
In order to transform a number in String datatype to a number in a numeric datatype you need to convert it.
In the given case there is a comma separated lost of numbers stored in a String datatype. In order to get it as numbers, you'd need to create an array of numbers from it and address each value from the array's index.
If you use the String (list of numbers) as a betting sequence, fxdreema does that work for you.
If you want to do this manually, you need to implement the de-seralization by yourself. -
@trader-philipps said in String variable adjustment using "Modify Variables" block?:
@l-andorrà String datatype is used for characters such as a b c, blanks and other special character and also numbers. However the values as numbers are not numbers to calculate with such as multiplication.
In order to transform a number in String datatype to a number in a numeric datatype you need to convert it.
In the given case there is a comma separated lost of numbers stored in a String datatype. In order to get it as numbers, you'd need to create an array of numbers from it and address each value from the array's index.
If you use the String (list of numbers) as a betting sequence, fxdreema does that work for you.
If you want to do this manually, you need to implement the de-seralization by yourself.And this is why a true programmer should be the only one answering in this forum. No me! LOL XD.