Order

class hokohoko.entities.Order(symbol_id: Union[int, int64], direction: Direction, open_bid: Optional[Union[float, float32]] = None, take_profit: Optional[Union[float, float32]] = None, stop_loss: Optional[Union[float, float32]] = None)

Bases: tuple

An order is a request for a trade within the FOREX environment.

Note

If setting both take_profit and stop_loss to None, the resultant Order and/or Position will automatically be closed at the end of the Bar.

Create new instance of Order(symbol_id, direction, open_bid, take_profit, stop_loss)

property symbol_id

[numpy.int64] The ID of the symbol trade is requested for.

property direction

[hokohoko.entities.Direction] What direction the trade is.

property open_bid

[numpy.float32] At what rate the Order will open a Position. Can be set to None to specify open immediately at the current price.

property take_profit

[numpy.float32] At what rate the resultant Position should close to realise profits. Can be set to None.

property stop_loss

[numpy.float32] At what rate the resultant Position should close to restrict losses. Can be set to None.