Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Vars #453908
08/18/15 16:55
08/18/15 16:55
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Hi, wich is the easiest way to calculate how many items are sored in a vars variable?

Thank you

Re: Vars [Re: MatPed] #453910
08/18/15 17:18
08/18/15 17:18
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
Hi MatPed. See series in the manual. When you create a vars with a series(), the 2nd parameter is the # of items; or if left out it defaults to LookBack. Is that what you're asking?

HTH.

Re: Vars [Re: DdlV] #453911
08/18/15 17:56
08/18/15 17:56
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
... not exactly, I' d like to know how many data have been stored in the vars, not the size

Re: Vars [Re: MatPed] #453914
08/18/15 18:12
08/18/15 18:12
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
What do you mean by "how many data"? Each run() stores a new value, so you mean the # of run() calls = the number of bars (up to the size you defined, then the oldest value is discarded)?

Re: Vars [Re: DdlV] #453917
08/18/15 19:26
08/18/15 19:26
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
ok

vars thePrice = series (price());

or something like that...

is there any way, without taking track with an external cointer, how manu values have been stored in the array at a certain time?

Re: Vars [Re: MatPed] #453920
08/19/15 02:30
08/19/15 02:30
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
For your example of series(price()) (where length is omitted and therefore defaulted to LookBack), min(Bar,LookBack)?

Re: Vars [Re: DdlV] #453925
08/19/15 03:59
08/19/15 03:59
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline
Senior Member
boatman  Offline
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I think it will always be equal to LookBack

Re: Vars [Re: boatman] #453928
08/19/15 07:31
08/19/15 07:31
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Yes, you are right. Thank you Ddlv and boatman!

Re: Vars [Re: MatPed] #453936
08/19/15 12:20
08/19/15 12:20
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
Hi boatman. Not necessarily:

a) I believe MatPed was asking about the number of values stored so far. On the 1st bar that would be 1, 2nd bar 2, etc. Up to the defined length. Thereafter length.

b) length defaults to LookBack, but can be set to anything. If you create a series of length 2, then on the 1st bar 1 value has been stored; thereafter only 2. Similarly, if length is >LookBack then more than LookBack values eventually get stored.

HTH.

Re: Vars [Re: DdlV] #453968
08/21/15 15:43
08/21/15 15:43
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
DdlV, yes you are right, but I guess the boatman was right too.
If you store the price() in vars for sure the analysis wil not start unless the lookback period is passed. So the number of items stored in the vars will be always equal to lookback.
If the value are not prices but other numbers The issue could be solved initialing all the vars with a predefined value. So counting the number of significant valus stored will be an easy loop.

ciao


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1