Skip to content

Interactive Brokers outsideRth field #2615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tomek-r opened this issue May 8, 2025 · 2 comments
Open

Interactive Brokers outsideRth field #2615

tomek-r opened this issue May 8, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@tomek-r
Copy link

tomek-r commented May 8, 2025

Feature Request

It looks like there is no possibility to send the order with flag outsideRth set to True
Can it be done?

Problem Statement

The flag is hardcoded to False:

class Order(Object):
    .....
    self.outsideRth = False
    ....

I want to send order to be executed outside regular trading hours.

Proposed Solution

Make the flag configurable

Example Usage

bracket_order_list: OrderList = self.order_factory.bracket(
                instrument_id=self.config.instrument_id,
                order_side=OrderSide.SELL,
                entry_order_type=OrderType.STOP_LIMIT,
                entry_price=self.instrument.make_price(bar.low - self.instrument.price_increment),
                entry_trigger_price=self.instrument.make_price(bar.low - self.instrument.price_increment),
                tp_price=self.instrument.make_price(bar.low - self.config.take_profit_points - self.instrument.price_increment),
                sl_trigger_price=self.instrument.make_price(bar.low + self.config.take_profit_points - self.instrument.price_increment),
                sl_time_in_force=TimeInForce.GTC,
                quantity=self.instrument.make_qty(1),
                time_in_force=TimeInForce.GTC,
                tp_post_only=False
                outsideRegularTradingHours=True
            )

Alternatives Considered

What alternatives have you explored? Why is this solution preferred?

Additional Context

Perhaps it is possible already but I did not find the way except changing the flag to True in the source code.

@tomek-r tomek-r added the enhancement New feature or request label May 8, 2025
@FGU1
Copy link
Contributor

FGU1 commented May 15, 2025

It is doable with IBOrderTags.
In factories.pyx, class cpdef OrderList bracket there is :
list[str] entry_tags = None,
list[str] sl_tags = None,
list[str] tp_tags = None,
Example of use :
sl_tags=[IBOrderTags(outsideRth=True).value],

See in documentation :
https://nautilustrader.io/docs/latest/api_reference/adapters/interactive_brokers#class-ibordertags

@FGU1
Copy link
Contributor

FGU1 commented May 29, 2025

Could you please check and validate the closure of this issue if ok for you ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants