Hi All,
When I try to place a buy order at in UATCert environment using DefaultAccount, the order fails. When I went and checked the logs I found the below logged:
Failed to send order: Details: Account is not set for order id=
I do have permession to trade.
I am using code from TT SDK Sample for OrderRouting.
OrderProfile op = new OrderProfile(e.Fields.Instrument);
op.BuySell = BuySell.Buy;
op.OrderQuantity = Quantity.FromDecimal(e.Fields.Instrument, 10);
op.OrderType = OrderType.Limit; op.LimitPrice = e.Fields.GetBestBidPriceField().Value - 1;
Thanks
Answer by swatijain · Dec 02, 2020 at 03:45 PM
@sushantmandal
As the failure says, please set the account for the order similar to this:
op.Account="ABC;
Please make sure to use a valid account.
You can refer to Order sample for further clarification:
https://github.com/tradingtechnologies/TT_Samples/tree/master/TT_NET_CLIENT_SIDE/TTNETAPI_Sample_Console_OrderRouting
@swatijain I have set it as Default Account.
op.Account = m_api.DefaultAccount
@sushantmandal The DefaultAccount is set to the random account and unless you only have 1 and exactly one account, it is best to explicitly set the account. If there are no accounts assigned to your user, the DefaultAccount will be null and you will receive the Account is not set error. A list of valid accounts assigned to your usre can be located via the TTAPI.Accounts property.
Ask questions and share ideas about the TT® and X_TRADER® platforms.
First time here? See our Getting Started Guide and FAQs.
© 2017 Trading Technologies International, Inc. All rights reserved.
Powered by AnswerHub