Hi,
I am testing the Tradovate API via the C# example on github. I can successfully place and Buy/Sell orders.
But when I try to use the startorderstrategy for a bracket order with this code:
var ordersApi = new OrdersApi();
var request = new StartOrderStrategy(accountId: account.Id,
accountSpec: account.Name,
symbol: symbol,
orderStrategyTypeId: 2,
action: (StartOrderStrategy.ActionEnum)action
);
request.Params = "{\"entryVersion\":{\"orderQty\":1,\"orderType\":\"Market\"},\"brackets\":[{\"qty\":1,\"profitTarget\":2,\"stopLoss\":-3,\"trailingStop\":false}]}";
var response = await ordersApi.StartOrderStrategyAsync(request);
I get the error:
Tradovate.Services.Client.ApiException
HResult=0x80131500
Message=Error calling StartOrderStrategy:
Source=Tradovate.Services
StackTrace:
at Tradovate.Services.Api.OrdersApi.d__238.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Tradovate.Services.Api.OrdersApi.<StartOrderStrategyAsync>d__237.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()
I can see that all the required are filled in correctly.
Does anybody have success with this? If yes, can you please share the request example?
Thanks alot!