Skip to content

Conversation

@GuillaumeDSM
Copy link
Member

No description provided.

@GuillaumeDSM GuillaumeDSM requested a review from Herklos November 17, 2024 12:22
@GuillaumeDSM GuillaumeDSM self-assigned this Nov 17, 2024
@GuillaumeDSM GuillaumeDSM marked this pull request as ready for review November 17, 2024 12:22
initialized_order = await trading_mode.create_order(order)
if (
isinstance(initialized_order, trading_personal_data.LimitOrder)
and initialized_order.trader.exchange_manager.trader.simulate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and initialized_order.trader.exchange_manager.trader.simulate
and initialized_order.is_simulated()

I don't remember if this method exists

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, there is a simulated attribute, I update this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up

initialized_order = await trading_mode.create_order(order)
if isinstance(initialized_order, trading_personal_data.LimitOrder) and initialized_order.simulated:
# on simulator, this order should be instantly filled now as its price is meant to be instantly filled
await initialized_order.on_fill()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we create a wrapper like create_market_order that creates a market order or a limit order (depending on what's available for this exchange) and that triggers order.on_fill() for the limit order.
It seems to be an issue that could happen again in another function who would do the same thing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, it's now in convert_with_market_or_limit_order

Copy link
Member

@Herklos Herklos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@GuillaumeDSM GuillaumeDSM merged commit 5d5f73d into master Nov 17, 2024
6 checks passed
@GuillaumeDSM GuillaumeDSM deleted the cnv branch November 17, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants