Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Oanda Roll (swap) Actually Available? #483202
05/10/21 16:26
05/10/21 16:26
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
The Manual states that swap is not available via the Oanda V20 API.

However, the Python script which has been posted in the Forum and uses the V20 API returns RollLong and RollShort values, and these values change when the script is run at different times.

Is the Manual incorrect?

Re: Oanda Roll (swap) Actually Available? [Re: DdlV] #483262
05/13/21 11:18
05/13/21 11:18
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
@jcl, would appreciate your thoughts. There seem to be 3 possibilities:

- The manual is incorrect and the API V20 does have swap values.
- The manual is correct and the Python script is incorrect - what it's returning for swap is invalid.
- The Python script is correct and the manual is sort of correct - something like swap is in the API V20 but the plugin isn't coded to capture it?

Thanks.

Re: Oanda Roll (swap) Actually Available? [Re: DdlV] #483267
05/13/21 16:09
05/13/21 16:09
Joined: Sep 2019
Posts: 63
Naperville
K
kzhao Offline
Junior Member
kzhao  Offline
Junior Member
K

Joined: Sep 2019
Posts: 63
Naperville
Which Python script are you referring to? It would be great to the swap values.

Re: Oanda Roll (swap) Actually Available? [Re: DdlV] #483268
05/13/21 17:56
05/13/21 17:56
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609

Re: Oanda Roll (swap) Actually Available? [Re: DdlV] #483270
05/13/21 23:19
05/13/21 23:19
Joined: Sep 2019
Posts: 63
Naperville
K
kzhao Offline
Junior Member
kzhao  Offline
Junior Member
K

Joined: Sep 2019
Posts: 63
Naperville
@DdIV Thanks.

Re: Oanda Roll (swap) Actually Available? [Re: DdlV] #483273
05/14/21 15:16
05/14/21 15:16
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
If the API provides it, the documentation does not say how.

If I had to guess, it's probably secretly output via the /v3/accounts/{accountID}/instruments endpoint, probably supplying the InstrumentFianancing primitive for each instrument.

Re: Oanda Roll (swap) Actually Available? [Re: DdlV] #483300
05/17/21 12:13
05/17/21 12:13
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Thanks @AndrewAMD. This bit of the Python code would seem to support your guess:

Code
# Calculate RollLong and RollShort in account currency, for the quantities used by Zorro
financing_pos_size = defaultdict(lambda: 1, {'CURRENCY': 10000})    # Everything but CURRENCY defaults to 1
data['RollLong'] = data['financing.longRate']/365 * \
                   data['Price'] * \
                   data['type'].map(financing_pos_size) * \
                  (data['currency']+'/'+ACCOUNT_CURRENCY).map(conversion_rate)
data['RollShort'] = data['financing.shortRate']/365 * \
                    data['Price'] * \
                    data['type'].map(financing_pos_size) * \
                   (data['currency']+'/'+ACCOUNT_CURRENCY).map(conversion_rate)


Would still appreciate @jcl's thoughts. Of course "we don't code to undocumented things" is an appropriate response, but perhaps the plug-in could handle these via a "use at your own risk" option?

Thanks.

Re: Oanda Roll (swap) Actually Available? [Re: DdlV] #483313
05/18/21 14:45
05/18/21 14:45
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I would like to answer "we don't code undocumented things", but in fact we do that. We'll check if we can implement the rollover on the next Oanda plugin revision.

Re: Oanda Roll (swap) Actually Available? [Re: DdlV] #483317
05/19/21 00:20
05/19/21 00:20
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Thanks @jcl!


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