• Ask a question
  • Spaces
    • TT® Platform
    • Autospreader®
    • Autotrader™
    • Charting & Analytics
    • Options
    • ADL®
      • ADL Samples
    • RTD
    • APIs
      • TT .NET SDK
      • TT API & XT API
      • TT REST API
    • Cryptocurrencies
    • Topics
    • Questions
    • Articles
    • Ideas
    • Badges
  • Sign in
  • Home /
  • APIs /
  • TT .NET SDK /
avatar image
0
Question by sushantmandal · Dec 02, 2020 at 03:42 PM · TT.NET.SDK

Not able to place orders

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

Comment
Add comment
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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


Comment
Add comment Show 2 · Share
10 |1800 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sushantmandal · Dec 03, 2020 at 04:23 AM 0
Share

@swatijain I have set it as Default Account.

op.Account = m_api.DefaultAccount

avatar image trishmessina sushantmandal · Dec 03, 2020 at 01:43 PM 0
Share

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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Community

Ask questions and share ideas about the TT® and X_TRADER® platforms.

First time here? See our Getting Started Guide and FAQs.

Follow

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

TT.NET SDK 4 Answers

Price of a product in real time with TT.NET SDK example 4 Answers

Can I subscribe to the same instrument via two applications with two different app keys? 1 Answer

Trade Subscription Product Filter 1 Answer

Site Order Key for each order 2 Answers

Trading Technologies Home - Legal - Privacy - Contact

© 2017 Trading Technologies International, Inc. All rights reserved.

Powered by AnswerHub

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • TT® Platform
  • Autospreader®
  • Autotrader™
  • Charting & Analytics
  • Options
  • ADL®
    • ADL Samples
  • RTD
  • APIs
    • TT .NET SDK
    • TT API & XT API
    • TT REST API
  • Cryptocurrencies
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges