dubcanada Posted June 29, 2021 Report Share Posted June 29, 2021 Hello, I am using IB and hotkeys to place orders based on things like Price-0.02, etc. And on a few stocks (such as NIO) all prices should be 0.01, but sometimes when I place an order the initial price shows up as 16.3467 for example, which gives me a IB Price Variation for this Contract error. Is there anyway to round numbers down or up with hotkey or saved orders or some other way? I don't trade crypto or forex so I really don't need anything under 0.01 increments. Thanks, Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted June 30, 2021 Report Share Posted June 30, 2021 Hm. if you use bid/ask you would not get that, but Price (which is LAST) can be more than 2 decimals . will see Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted June 30, 2021 Report Share Posted June 30, 2021 https://www.medvedtrader.com/trader/WebHelp/variables_and_conditions_secti.htm look for round, floor, ceil functions and their variants. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted July 7, 2021 Report Share Posted July 7, 2021 I also changed the code so that the prices will be rounded to trading increments automatically. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.