¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

How to check order init margin (Java API)


 

Hi. I have to check option order margin requirements.

For that purpose Im sending whatif order and gather info from return data. But sometimes Im recieving?openOrder responce:?m_initMarginChange=1.7976931348623157E308

As I understand, that is the max number. Why API returns such strange value? Is it possible somehow to get margin impact of my planed order correctly?

Thanx

?


 

TWS API uses Double.MAX_VALUE or Integer.MAX_VALUE to indicate a field/value that is not present, not known, or not initialized.

A MAX_VALUE response for initMarginChange in orderStatus (not openOrder, right?) suggests that the order you are asking for is not tradable in that form at the time when you make the request. Keep in mind that the margin requirements you receive are specific to the account used for the request so that trading permissions need to exist.

What happens when you use "Check Margins" for the same option in TWS?

´³¨¹°ù²µ±ð²Ô


 

Thank you for your reply! Im trying to place LMT orders before market opens. Very strange situation, because other strikes for same expiration returns correct margin requirements..