Open rsmb7z opened 1 year ago
Hey @rsmb7z, I agree we should have some helper functions like this.
I started working on something like this here
It looks like we did start to implement this for Forex pairs, so if you pass a tick scheme name when creating the instrument you can use instrument.tick_scheme.next_ask_price
Sounds goods. I will check for other securites how we can take advantage of this and register more schemas.
Hi @limx0 Can you please register following tick schemas.
{'marketRuleId': 67, 'priceIncrements': [{LowEdge: 0, Increment: 0.25}]}
<< CME Futures{'marketRuleId': 109, 'priceIncrements': [{LowEdge: 0, Increment: 0.01}, {LowEdge: 3, Increment: 0.05}]}
<< Options{'marketRuleId': 633, 'priceIncrements': [{LowEdge: 0, Increment: 0.0001}]}
<< CME Forex{'marketRuleId': 26, 'priceIncrements': [{LowEdge: 0, Increment: 0.01}]}
<< Mostly Stocks, Options (some exchanges), FuturesJust FYI to give up the additional possible scenario, these marketRuleId are dependent on Exchange and not with instrument though available in ContractDetails
under validExchanges
and marketRuleIds
. For example one Option which may have multiple ValidExchanges for trading, may have rule Id 26 for one exchange and 109 for other which would apply to the relevant exchanges when placing the order.
Hey @rsmb7z, sure thing! Thanks for doing some research here. I have a couple of questions I sent through to you on discord in the IB channel.
Feature Request
There are situation where Exchange have requirement for the Order price to be in increments (as per instrument) even though the
Tick
,Bar
etc prices may not be in increments that increments. So in such situations Order will be rejected. It would be good to add helper function something like below in Instrument base class to allow use of this instead ofmake_price
when placing Order.For instance for InteractiveBrokers EUR/USD
price_precision=5
andprice_increment=0..00005