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