Ib controller $ amount orders

Hello,

I have looked high and low but can't find an answer to this question:

Is there a way I can send a $ amount order through IB Controller instead of specifying the number of shares?

I know IBKR accepts them, but not sure if it can be done via the API and I don't have the technical knowledge to be able to check.

Example:
BUY $10,000 QQQ MOO ?

Thanks a lot!
A-

You could simply use some math (inside AFL):

Quantity = Value / Price; 
// If you would like, you can round down the result using the floor() function.
Quantity = floor(Quantity);

where Price is current (Last) price - i.e. LastValue( Close ) or GetRTValue( "Last")

Thanks for responding @Tomasz

Yes, I am currently using this formula but this transmits to IBKR a number of shares to buy however my question was if we can transmit a $ amount instead.

Is there a way I can send a $ amount order through IB Controller instead of specifying the number of shares?

IKBR App, Web and TWS all allow for that... but I don't know if it allows it through API and don't know how to check either :man_shrugging:

I have some digging and found that the API has a thing called CashQty but I have no clue if it applies to this or not... way over my head here :slight_smile:

The practical relevance is as follows:

Let's say I have a retirement account with $1000 (or just a cash account) and want to buy XYZ with 100% of equity available at the open... so I enter the day prior a GTC MKT order to buy 10 shares because the LastClose is $100... if XYZ gaps up say 5% my order will be rejected...

So we have two go-arounds possible here:

1- Use GetRTValue( "Last") as specified above but it means that I need to be on my PC at the open which is not always possible.

2- Send a Cash Quantity order and let IBKR do the position sizing at the Open...

For margin accounts it makes no difference, so this is just for cash accounts like most retirement accounts in the US.