Trouble Submitting Bracket Order via API

Thank you @gustrom, that is exactly what I’ve been doing. It turns out the limitations have actually helped me customize my strategy better. It took me a while to get a feel for the other order types, but in the end, placeOrder does everything I need it to do.

One of the issues I see with startOrderStrategy for the future is that there is no isAutomated boolean. Also, the entire params input feels a little messy and lacks proper documentation for all the parameter types.

Anyway, good luck to you! Let me know when you have something working well for you.

I agree about the flexibility of customizing the brackets with separate functions.

However, there are still some advantages in using the startOrderStrategy endpoint in my opinion. For instance, the brackets won’t depend upon the script successfully getting and processing the right values from the trade response in order to request the brackets orders.

Also, for scapling or very quick strategies, there’s less order delay since the brackets instructions are already in tradovate’s server even before the 1st trade takes place. So we’d gain the time that results from adding: (getting response of 1st trade delay + delay of the server getting the OCO command afterwards).

1 Like

Alex

Not to be a negative nelly… but I had working strategyorder code that was running in live until this bug was introduced. I’ve lost several days trying to get it working again… with the same code that was working… and tried every example provided in this thread as well as in github…pulling my hair out.

I appreciate you finally acknowledging the bug. I really like the software tradovate offers, but more important than any of the features is basic stability. If Tradovate is going to change the way the API endpoints work you have to let us know with ample time change any of our affected systems. It’s been weeks since this was working.

I am just a simple brokerage client… but I can’t imagine the business partners using the same API feel any different.

1 Like

Am I correct in assuming that this bug also renders a good chunk of the code/examples here: https://github.com/tradovate/example-api-trading-strategy broken/unusable at the moment? Since, it’s mostly based on the orderStrategy/startOrderStrategy endpoint?

Unfortunately that is correct for the time being. I understand that this can be frustrating, but there will be a fix soon. It is already in development, it just takes time to get an update into release. In the mean time, using placeOSO and placeOCO can help you create your own brackets-like strategy.

@Alexander Any update on this? It’s been nearly two months. Is placing bracket orders via API still unavailable?

I’ve received an update recently that the solution for starting Bracket orders via API is on the horizon. In one to two weeks we should see the solution released. When I see it in the upcoming release notes I’ll update this page with an exact date.

1 Like

Thank you so much Alexander! Look forward to hearing back soon.

Good news, everyone! This weekend’s release will include the fix for placing bracket orders via API. By Monday we should be able to use the orderStrategy/startOrderStrategy endpoint again.

3 Likes

Sounds awesome! Thanks for the update.

Has anyone @here tried to implement this feature since the update?

I’m getting the same 404 error.

I think the update will be live by Monday March 14, 2022.

Thanks, can you point me to where you found that information?

@Alexander said

This Weekend’s release

That was 5 days. Try again after Sunday open.

This should be working now, can anyone verify that this is currently working or reproduce Arthur’s error? And @Arthur if you could share more info about your request body and the response, that would be helpful.

Sure, here is the exact request body followed by the response, lifted directly from the GitHub example to make sure nothing was lost in translation:

See that collapsed property, sync data? Open that up and look at the orderStrategyTypes field for me.

I’m afraid it is just the server response, and not what you’re looking for:

I just tried the feature and is working fine for me.

As a suggestion, double check that you’re connecting your socket to ‘wss://demo.tradovateapi.com/v1/websocket’ (same url used for sync requests) instead of the one used for market data.

Also, avoid using ‘socket.subscribe()’ (in case you’re using the tutorial tradovate socket files), make sure to use the ‘socket.send()’ method instead.

Let us know your results… :crossed_fingers:

The other thing that should be considered is the deviceId field when you are requesting an access token. On Live, you strictly need to provide the deviceId or operations with that token may fail.