Etrade API response indicates missing "stopPrice" field/value when its in the request payload - algorithmic-trading

Technical issue with etrade API.
I am constructing a trailing stop sell-to-close order with the following preview in Sandbox:
"{"PreviewOrderRequest":{"orderType":"OPTN","clientOrderId":"27099010699269ea2bee","Order":[{"allOrNone":"false","priceType":"TRAILING_STOP_CNST","orderTerm":"GOOD_FOR_DAY","marketSession":"REGULAR","trailPrice":".15","stopPrice":0,"Instrument":[{"Product":{"symbol":"MSFT","securityType":"OPTN","callPut":"CALL","expiryYear":"2021","expiryMonth":"9","expiryDay":"24","strikePrice":"290"},"orderAction":"SELL_CLOSE","orderedQuantity":"10","quantity":"10"}]}]}}"
However, in response, I am receiving the following error message:
"{"Error":{"code":7,"message":"You did not specify a stop price. Please fill in the missing information and resubmit your order."}}"
As you can see, I am setting the "stopPrice":0 in the order object. I put zero "0" since this is the value used in several examples from the documentation:
https://apisb.etrade.com/docs/api/order/api-order-v1.html#/definitions/OrderDetail
And I tried it as both a number and string: "stopPrice":"0" without success.
Is there a different field/value to set or format/configuration to make this work?

The obvious question is whether 0 is a valid value.
I'd be surprised if it is, but it's easy to check.

Related

Access the replied/forwarded/etc state from REST

I am trying to get and set the forwarded/replied state of an email message in the Graph API. This is the represented in OWA by the little icon in the right column.
It seems there is not a first class way to access this information, at least it does not come out in the unfiltered JSON dump.
Google suggests this is stored in the extended properties for PidTagLastVerbExecuted or PidTagIconIndex, however attempts to access these just give back 404:
https://graph.microsoft.com/beta/me/mailFolders/{id}/messages?$select=SingleValueExtendedProperties&$expand=SingleValueExtendedProperties($filter%3Did+eq+'String+0x1081')
Other extended properties like 0x0070 do work, so it seems the syntax is correct, and 0x1081 comes from here https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtaglastverbexecuted-canonical-property
This information is stored, you can see it in OWA, the Outlook apps, and you can see it in IMAP.
Is there some way to do this? It seems strange this basic information about the email state is not made available.
Your specifying the wrong datatype that property is defined as a Long in the documentation (but the doco is for MAPI) so its actually an Integer in EWS and Graph eg this is something i used to return both PidTagLastVerbExecuted and PidTagLastVerbExecutedTime (which gives you the time of the last action)for a particular message
/v1.0/users('user#domaincom')/MailFolders/AllItems/messages/?$select=ReceivedDateTime,Sender,Subject,IsRead,inferenceClassification,InternetMessageId,parentFolderId,hasAttachments,webLink,InternetMessageHeaders&$Top=1000&$filter=internetMessageId+eq+%27%3cSG2PR04MB3223962312D5B46D0C9CA1B5C89C0%40SG2PR04MB3223.apcprd04.prod.outlook.com%3e%27&$expand=SingleValueExtendedProperties($filter=(Id%20eq%20'Integer%200x1081')%20or%20(Id%20eq%20'SystemTime%200x1082'))

In #ngxs/form-plugin, what is the definition of the properties mentioned in the example?

Please expand your NgxsFormPluginModule description on gitbook.
I just implemented a reactive forms example with #ngxs/form-plugin.
It works great, but it was a bit of a struggle to get it to work; because it was not clear to me that the form state must have these specific properties:
model: YourFormModel,
dirty: boolean,
status: string,
errors: {}
Maybe you could add an explanation of these properties and their intended use?
What are the possible values for status, or is this up to the developer to define?
What type of object is errors and what is it used for? It appears to be empty even when validation fails. errors would suggest it is an array, but the example defines the default as an object?
I am posting this as a question because of your answer here: Where is it best to post questions about ngxs?
status field is supposed to store latest status of FormGroup.
You can see the code that is responsible for its update here.
The possible values for status are defined here.
errors is supposed to contain validation errors for the whole form group.
Its type is ValidationErrors since it's supposed to copy errors from the corresponding form group.
The code responsible for its update is supposedly here.
But there's an unsolved issue with filling it with actual error data., so it's not available yet and you'll have to rely on controls' error data.

MailChimp API 3.0 search-members query format

I’m trying to use the MailChimp - Search Members function. I want to use this action as a general search for retrieving members from all lists which match a query.
When I try the URI as formatted in the example:
https://us13.api.mailchimp.com/3.0/search-members?query=freddie#
I get the following error:
{"type":"https://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"Invalid Resource","status":400,"detail":"An error occurred: Sorry, we're unable to search at the moment.","instance":""}
If I leave out the query parameter I receive the following error:
{"type":"https://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"Invalid Resource","status":400,"detail":"Please provide 'query' parameter in the query string to search","instance":""}
So the method is available and my request URI is being parsed.
I conclude that the query parameter is incorrectly formed, however after extensive research I cannot find out how to format the query parameter.
This was an issue at Mail Chimp.
If you get it make a GET call to your root url e.g.
https://us13.api.mailchimp.com/3.0/
And send them your account Id along with the issue.
They can then reindex your lists.
Thanks anyone who invested time in this issue
See reply below.
J (MailChimp)
Jul 24, 5:49 PM EDT
Hey Dev, thanks so much for providing that info. I found the account and was able to replicate the error you are seeing - looks like it's account specific.
I reindexed your lists and then was able to make the same call successfully this time. If you do ever run across this issue again, that is likely what is going on. Shooting us an email or jumping in chats with this request will get it resolved in no time :)
Let me know if you are still experiencing that same error when making this call and I'll be happy to take another look, but you should be good to go at this point. Hope all is well, and have a great rest of your week!
============================================

Response data is changed when calling web api using ajax request

I have a web api which is returning a list(each item consists of bit values).
But when I see response from client side in console, I found that the bit value is changed.
For example if I have 36028797018963968 bit value in database then it is changed to 36028797018963970.
This is happening only for this bit value. In a list of 5 values only the above mentioned value is changing. The remaining are coming fine.
I have never seen this type of behaviour before, so I am not sure what else I should be posting here. Ask me if you need anything else.
There is no limitation for integer values in Json. But Javascript has boundaries.
JSON transfer of bigint: 12000000000002539 is converted to 12000000000002540?

Retrieve comments for specific thread

i just start using yammer rest api and i need to get the comment on some thread.
The problem is, that, when i use the "Threaded: extended" parameter, i just got the 2 last comments. I tried to make a request using message api with "older_than" and "newer_than" parameter and as value, the "first_reply_id" and the "latest_reply_id" but it gave me another set of thread different from the comment list that i want to get.
Did anyone have an idea. thanks.
finally and thanks to this thread i used the following rest URL :
messages/in_thread/[message_ID].json
so, as i understand, the trick is to make request until the meta parameter "older_available" on json response is false or null, and for each message on the same json, check if the "replied_to_id" correspond to your thread ID. it's the only solution that i found until now and i'm not going to use it, as the rest api have limits on request number per time laps.

Resources