GithubHelp home page GithubHelp logo

Comments (6)

jessecooper avatar jessecooper commented on May 27, 2024

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.

arighna avatar arighna commented on May 27, 2024

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.

arighna avatar arighna commented on May 27, 2024

I accidentally closed the issue!

from pyetrade.

arighna avatar arighna commented on May 27, 2024

accountIdKey

is the 'accountIdKey' same as accountId?

from pyetrade.

smokinu avatar smokinu commented on May 27, 2024

'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.

arighna avatar arighna commented on May 27, 2024

'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?

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.