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
Creating series of spread with / operation #463889
01/03/17 09:10
01/03/17 09:10
Joined: Apr 2013
Posts: 35
J
Joaquin Offline OP
Newbie
Joaquin  Offline OP
Newbie
J

Joined: Apr 2013
Posts: 35
Hi again,
I've found something weird and I don't know the reason. According to the documentation, one can create artificial series variables of different assets or of different series variables just by doing something like

vars spread = series(asset1[0] + asset2[0]);

Being asset1 and asset2 series of closing prices of 2 different assets.
So far so good. But what I was trying to do was

vars pairsRatio = series(asset1[0] / asset2[0]);

And that operation always gives 1 as a result.
It is not a big problem, as I have seen that

vars pairsRatio = series(asset1[0] * asset2[0]);

works correctly, so with this operation I can get what I was looking for. Just wanted to ask if this behavior with the / operation is normal or not...

Thanks again jcl!

Last edited by Joaquin; 01/03/17 09:11.
Re: Creating series of spread with / operation [Re: Joaquin] #463908
01/05/17 12:11
01/05/17 12:11
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
No, series(x/y) is not always 1 except when x and y are always equal. So check the values of asset1 and asset2.

Re: Creating series of spread with / operation [Re: jcl] #463949
01/09/17 10:00
01/09/17 10:00
Joined: Apr 2013
Posts: 35
J
Joaquin Offline OP
Newbie
Joaquin  Offline OP
Newbie
J

Joined: Apr 2013
Posts: 35
LOL . My fault, x and y were the same... Sorry!


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