Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Imhotep, opm), 785 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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