Hello
In a function, I want to create a list of numbers separated by a comma like
Alist=(1.2345,1.2356,1.2367,1.2389) What kind of variable should I declare. It can't be a number since a comma will separate the list.
I could declare the list as a string, then use a Str2Num, but if there is another way, i would use it
I want to use these number ( alist) in a maxlist(alist).
Is it possible to not define my variable list as a string?
Martin
A list of number in variable: Wath type of variable? [SOLVED]
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: A list of number in variable: Wath type of variable?
How you go about making this function depends onHello
In a function, I want to create a list of numbers separated by a comma like
Alist=(1.2345,1.2356,1.2367,1.2389) What kind of variable should I declare. It can't be a number since a comma will separate the list.
I could declare the list as a string, then use a Str2Num, but if there is another way, i would use it
I want to use these number ( alist) in a maxlist(alist).
Is it possible to not define my variable list as a string?
Martin
what, where, and how you want to use the end result.
Re: A list of number in variable: Wath type of variable?
Hello TJHow you go about making this function depends onHello
In a function, I want to create a list of numbers separated by a comma like
Alist=(1.2345,1.2356,1.2367,1.2389) What kind of variable should I declare. It can't be a number since a comma will separate the list.
I could declare the list as a string, then use a Str2Num, but if there is another way, i would use it
I want to use these number ( alist) in a maxlist(alist).
Is it possible to not define my variable list as a string?
Martin
what, where, and how you want to use the end result.
The end result to be use in a MaxList function
MaxList(Value1,Value2,Value3... etc). The Number of iteration of Value(x) to be defined by an input value
So my variable as to be a list like alist=(1.2345,1.2356,1.2378)
Hope I'm clearer
Martin
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: A list of number in variable: Wath type of variable?
You don't need to create a function, you can simply add the variables directly to Maxlist.Hello TJ
The end result to be use in a MaxList function
MaxList(Value1,Value2,Value3... etc). The Number of iteration of Value(x) to be defined by an input value
So my variable as to be a list like alist=(1.2345,1.2356,1.2378)
Hope I'm clearer
Martin
Re: A list of number in variable: Wath type of variable?
Good day TJ
The number of variable is to be defined by a an Input value
What I want to do.
I'm defining and show a bar that as depict an increase of volatility. To do so, I compare body's of previous bar. If the actual body is greater than (x) numbers of body bar before, then this bar
is a Wide Range Bady ( WRB)
Actually, my code is hard coded to look for the previous 3 bars like
If Body[1] is > Maxlist(Body[2],Body[3],Body[4]) then WRB = True
Now, I want to modify my code so it would be flexible in the numbers of bar ago I want to check. To do so, my idea was to build my data string instead of hard coded one like I actually do.
Martin
The number of variable is to be defined by a an Input value
What I want to do.
I'm defining and show a bar that as depict an increase of volatility. To do so, I compare body's of previous bar. If the actual body is greater than (x) numbers of body bar before, then this bar
is a Wide Range Bady ( WRB)
Actually, my code is hard coded to look for the previous 3 bars like
If Body[1] is > Maxlist(Body[2],Body[3],Body[4]) then WRB = True
Now, I want to modify my code so it would be flexible in the numbers of bar ago I want to check. To do so, my idea was to build my data string instead of hard coded one like I actually do.
Martin
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: A list of number in variable: Wath type of variable? [SOLVED]
You can do this:Good day TJ
The number of variable is to be defined by a an Input value
What I want to do.
I'm defining and show a bar that as depict an increase of volatility. To do so, I compare body's of previous bar. If the actual body is greater than (x) numbers of body bar before, then this bar
is a Wide Range Bady ( WRB)
Actually, my code is hard coded to look for the previous 3 bars like
If Body[1] is > Maxlist(Body[2],Body[3],Body[4]) then WRB = True
Now, I want to modify my code so it would be flexible in the numbers of bar ago I want to check. To do so, my idea was to build my data string instead of hard coded one like I actually do.
Martin
Code: Select all
input:
Look.back(3);
Var:
WRB(false);
WRB = Body[1] > Highest( Body, Look.back )[2];