Profile Picture

Relationship between OpenPosition and OrderUpdated event

Posted By neo 4 Years Ago

Relationship between OpenPosition and OrderUpdated event

Message
neo
Supreme Being (4,009 reputation)Supreme Being (4,009 reputation)Supreme Being (4,009 reputation)Supreme Being (4,009 reputation)Supreme Being (4,009 reputation)Supreme Being (4,009 reputation)Supreme Being (4,009 reputation)Supreme Being (4,009 reputation)Supreme Being (4,009 reputation)
Posted Saturday May 11 2013
I'm a little confused about the relationship between OpenPosition in SymbolScriptBase class, and OrderUpdated event in PaperBroker.

Because in strategy (e.g. CrossOver), there is only OpenPosition, no such thing as OpenOrder or SubmitOrder. But in PaperBroker, there is no such thing as PositionOpened, the only OrderUpdated event and SubmitOrder method.

What is the intended workflow to be?
Strategy open an position, and broker being notified by OrderUpdated, then submit an order?

Thanks.
Posted Monday May 13 2013
It is all based on orders. Your system sends orders to the broker, and the broker notifies the system when something has changed with the order (usually it has been cancelled or filled).

The way RightEdge manages orders, each one is grouped under a position. So when you call OpenPosition(), it submits the an order to open the position. Until the order is filled the position state is "pending", when it is filled it will be "open". The Position class has SubmitOrder methods to submit additional orders for the position (to close or resize it, for example). You can also set the profit target or stop loss for a position which will cause the PositionManager to submit limit or stop orders for you.

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems