Comments (5)
Error on parsing TRADE_DATA ? Be specific please.
Examples will be extended the next weeks.
Please take a look at the specs OANDA has on developer.oanda.com.
All endpoints are well documented. I've implemented them in the same groups: orders, trades, positions etc. Parameters, data ... it is all in the specs.
To close a trade: http://developer.oanda.com/rest-live-v20/trades-ep/. The tradeID is the ID you got as feedback from the other example. Pass the data body and done.
If you would like to close half of the position opened with the other example you could do:
cfg = { "units": 50 }
r = trades.TradeClose(accountID, tradeID=tradeID, data=cfg)
rv = api.request(r)
print("== IV (reduce) ===================\nRESP: {} ".format(json.dumps(r.response, indent=4)))
(but markets are closed)
Other endpoints
r = trades.TradeDetails(accountID, tradeID)
r = trades.TradesList(accountID)
r = trades.OpenTrades(accountID)
r = trades.TradeClientExtensions(accountID, tradeID, data=...)
from oanda-api-v20.
Okay thank you. I was reading the documentation on http://oanda-api-v20.readthedocs.io/en/latest/oanda-api-v20.html which I assumed went with this package and when executing the first example
# get a list of trades
from oandapyV20 import API
import oandapyV20.endpoints.trades as trades
api = API(access_token="xxx")
accountID = "101-305-3091856-001"
r = trades.Trades(accountID, op=trades.TRADE_LIST)
# show the endpoint as it is constructed for this call
print("REQUEST:{}".format(r))
rv = api.request(r)
print("RESPONSE:\n{}".format(json.dumps(rv, indent=2)))`
I was getting the error
`Traceback (most recent call last):
File "test.py", line 8, in <module>
r = trades.Trades(accountID, op=trades.TRADE_LIST)
AttributeError: 'module' object has no attribute 'TRADE_LIST'
Which led me to believe that the documentation was outdated for I looked through your code and could not find any TRADE_LIST
from oanda-api-v20.
Thank you for the link to the endpoints. I must have overlooked that at some point.
from oanda-api-v20.
Hi,
this piece is outdated. It is based on the first design. As of PR #4 I've
changed the design.
The example under the examples-menu reflect the current situation.
I will fix the outdated piece.
Thx
2016-10-22 0:42 GMT+02:00 WestonShakespear [email protected]:
Okay thank you. I was reading the documentation on http://oanda-api-v20.
readthedocs.io/en/latest/oanda-api-v20.html which I assumed went with
this package and when executing the first example
`# get a list of trades
from oandapyV20 import API
import oandapyV20.endpoints.trades as tradesapi = API(access_token="xxx")
accountID = "101-305-3091856-001"r = trades.Trades(accountID, op=trades.TRADE_LIST)
show the endpoint as it is constructed for this callprint("REQUEST:{}".format(r))
rv = api.request(r)
print("RESPONSE:\n{}".format(json.dumps(rv, indent=2)))`I was getting the error
Traceback (most recent call last):
File "test.py", line 8, in
r = trades.Trades(accountID, op=trades.TRADE_LIST)
AttributeError: 'module' object has no attribute 'TRADE_LIST'Which led me to believe that the documentation was outdated for I looked
through your code and could not find any TRADE_LIST—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#26 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIQ6bRDKuKjjUs-WS7GdR7F_0Fd6nyyAks5q2T_bgaJpZM4KdouJ
.
Feite Brekeveld
feitebrekeveld https://nl.linkedin.com/in/feitebrekeveld
@feite_brekeveld https://twitter.com/feite_brekeveld
github https://github.com/hootnot
from oanda-api-v20.
Thank you
from oanda-api-v20.
Related Issues (20)
- PositionClose HOT 2
- Streaming OHLC data? HOT 3
- `InstrumentsCandles` Returns Candles from a few days ago HOT 1
- Unit not accepting less than 1 HOT 2
- Expiry time on Stop order not correct HOT 1
- Allow floats as unit size instead of integers HOT 3
- Proxy uses HTTP and not HTTPS HOT 1
- daily candles seem to be shifted one day HOT 1
- ContentDecodingError with InstrumentsCandles HOT 3
- API Connection keeps closing HOT 2
- Wrong implementation of units - "rejectReason":"UNITS_INVALID" HOT 1
- Client Access Not working for Instruments call or any data call HOT 1
- question for Feite HOT 1
- question for hootnot 2 HOT 1
- Keep on getting `The provided request was forbidden` error. HOT 4
- question for feit HOT 1
- asyncio support?
- Extend the pricing endpoints
- Add asyncio support
- Wrong bar values?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oanda-api-v20.