Comments (8)
The client_order_id
does need to be an int cast as a str. This is what i have working in my code without issue:
from random import randint
client_order_id = str(randint(1000000000, 9999999999))
from pyetrade.
I tried to use account_id instead of accountIdKey, i also tried to add in resp_type = "xml" in the function call. every time so far got to the same error...
from pyetrade.
Same issue here.
edit I figured it out, the expiry date format needs to be month-day-year
from pyetrade.
@xabaddonx1 I tried your suggestion, same error...
from pyetrade.
You must have another issue. I think the client order id needs to be unique for each order, i generate it with
clientOrderId = dt.datetime.timestamp(presentDate) * 1000000
maybe that's it.
from pyetrade.
Again, same error with this change... @xabaddonx1
from pyetrade.
Any update on this?
Running into the identical issue and have taken identical steps with no luck. Is this a bug in PyEtrade or picky E*Trade request formatting?
Odd that it works for some... @xabaddonx1 would you mind sharing your working request code and param formatting for option orders? Would be a large help.
from pyetrade.
Here's mine, a couple things I thought of:
It could be the clientOrderId needs to be an int.
resp = orders.place_option_order(
resp_format='xml',
accountId=brokerageAccountIdKey,
symbol=symbol,
callPut=callPut,
expiryDate=expiryDate,
strikePrice=formatNumber(strikePrice),
orderAction=action,
clientOrderId=int(clientOrderId),
priceType=priceType,
limitPrice=limitPrice,
allOrNone=False,
quantity=quantity,
orderTerm="GOOD_FOR_DAY",
marketSession='REGULAR')
i'm running the code below on strikePrice, I ran into an issue where sometimes it would say 12.0 and the api doesn't like that :
def formatNumber(num):
if num % 1 == 0:
return int(num)
else:
return num
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
- 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.