Comments (6)
https://apisb.etrade.com/docs/api/order/api-order-v1.html#/definition/orderPlace
make sure you are using the accountIdKey this area of code could use an update to align better with the terminology of V1 but it still works.
from pyetrade.
https://apisb.etrade.com/docs/api/order/api-order-v1.html#/definition/orderPlace
make sure you are using the accountIdKey this area of code could use an update to align better with the terminology of V1 but it still works.
Thank you for your response. I got passed the listing order section, thanks to your suggestion. I am more interested in the order placing post request though. Below is the error I am getting for the same.
``
AttributeError Traceback (most recent call last)
in
84 }
85
---> 86 req = session.post(api_url, json=payload, timeout=30)
87 req.json()
88
~/opt/anaconda3/lib/python3.7/site-packages/requests/sessions.py in post(self, url, data, json, **kwargs)
576 """
577
--> 578 return self.request('POST', url, data=data, json=json, **kwargs)
579
580 def put(self, url, data=None, **kwargs):
~/opt/anaconda3/lib/python3.7/site-packages/rauth/session.py in request(self, method, url, header_auth, realm, **req_kwargs)
179 url,
180 oauth_params,
--> 181 req_kwargs)
182
183 if header_auth and 'oauth_signature' not in \
~/opt/anaconda3/lib/python3.7/site-packages/rauth/oauth.py in sign(self, consumer_secret, access_token_secret, method, url, oauth_params, req_kwargs)
139
140 oauth_params =
--> 141 self._normalize_request_parameters(oauth_params, req_kwargs)
142 parameters = map(self._escape, [method, url, oauth_params])
143
~/opt/anaconda3/lib/python3.7/site-packages/rauth/oauth.py in _normalize_request_parameters(self, oauth_params, req_kwargs)
78 if 'Content-Type' in headers and
79 headers['Content-Type'] == FORM_URLENCODED:
---> 80 for k, v in data.items():
81 normalized += [(k, v)]
82
AttributeError: 'NoneType' object has no attribute 'items'
``
from pyetrade.
I accidentally closed the issue!
from pyetrade.
accountIdKey
is the 'accountIdKey' same as accountId?
from pyetrade.
'accountIdKey' and 'accountId' are different parameters on E-trade.
accountId | string | The user's account ID
accountIdKey | string | The unique account key
Were you able to get the code to work?
from pyetrade.
'accountIdKey' and 'accountId' are different parameters on E-trade.
accountId | string | The user's account ID
accountIdKey | string | The unique account keyWere you able to get the code to work?
I found the accountIdKey and I am able to list orders. However, I am not able to structure the payload dictionary. Below is what I am using to place the order.
api_url = f'https://apisb.etrade.com/v1/accounts/{account_id_key}/orders/place'
payload = {
"accountId": str(account_id),
"clientOrderId": str(clientOrderId),
"limitPrice": str(limitPrice),
"quantity": str(quantity),
"symbol": symbol,
"orderAction": orderAction,
"priceType": "LIMIT",
"marketSession": "REGULAR",
"orderTerm": "GOOD_FOR_DAY"
}
from pyetrade.
Related Issues (20)
- Are contingent orders actually supported? HOT 1
- oauth problems HOT 1
- oauth issue HOT 6
- [Warning!] ETrade API *sever* bug: Stop Price and Trailing Stop Parameter are swapped! HOT 3
- Preview order working but place order responding with same error again and again. HOT 1
- Verification code HOT 2
- Automatic Authentication HOT 2
- 401 Client Error: Unauthorized for URL in prod HOT 1
- auth server down on 2022-06-29
- 401 Client Error: Unauthorized for url HOT 2
- HTTPError: 401 Client Error: Unauthorized for url HOT 1
- oauth no longer working HOT 8
- Keep getting requests.exceptions.HTTPError: 400 Client Error: Bad Request for url when trying to place options order. HOT 8
- Exception: 500 Server Error: Internal Server Error for url When using preview_equity_order function
- Question about Etrade API HOT 2
- get_quote for an option call returns the put HOT 1
- Q: anyone saw this error: Token request failed with code 500 HOT 2
- SSL errors with Python 3.11 HOT 14
- urllib3 version needs to be 1.xx.xx HOT 2
- Cannot grab optionchain data with ETrade API in Python HOT 2
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 pyetrade.