Replies: 3 comments 1 reply
-
|
Check here: It's etrade problem, unbelievable! and they don't want to fix it! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks mw66! |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
@kgstorm , see #57 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can someone post an example of an equity SELL order with a TRAILING_STOP_PRCT price type, please?
I can buy and sell market orders just fine.
I'm not sure which parameters are required for the trailing stop percent order.
I figured it would just be:
accountId, symbol, orderAction, clientOrderId, quantity, marketSession, orderTerm, priceType, offsetType, and offsetValue.
I have experimented with limitPrice and trailPrice, but can't get anything to work.
Here's a sample failed set of key-word arguments:
kwargs = {'accountId':accountIDKey,'symbol':symbol,'orderAction':'SELL','clientOrderId':orderID,'quantity':quantity,'marketSession':'REGULAR','orderTerm':'GOOD_FOR_DAY','priceType':'TRAILING_STOP_PRCT','offsetType':'TRAILING_STOP_PRCT','offsetValue':0.3,'allOrNone':False}
FYI - this request has been through the sandbox environment.
I always get:
File "/home/xxx/xxx/./test_sell_sandbox.pex", line 280, in
bc = order.place_equity_order(**kwargs)
File "/usr/local/lib/python3.10/dist-packages/pyetrade/order.py", line 475, in place_equity_order
preview = self.preview_equity_order(resp_format, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/pyetrade/order.py", line 417, in preview_equity_order
return self.perform_request(self.session.post, resp_format, api_url, payload)
File "/usr/local/lib/python3.10/dist-packages/pyetrade/order.py", line 302, in perform_request
return get_request_result(req, resp_format, {})
File "/usr/local/lib/python3.10/dist-packages/pyetrade/order.py", line 49, in get_request_result
req.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://apisb.etrade.com/v1/accounts/<<sandbox_account>>/orders/preview
Thanks,
Kevin
Beta Was this translation helpful? Give feedback.
All reactions