oandapyV20.definitions.orders

Order related definitions.

class oandapyV20.definitions.orders.TimeInForce

Bases: object

Definition representation of TimeInForce

Definitions used in requests and responses. This class provides the ID and the description of the definitions.

>>> import oandapyV20.definitions.orders as deforders
>>> print deforders.TimeInForce.IOC
IOC
>>> c = deforders.TimeInForce()
>>> print c[c.IOC]
The Order must be “Immediately partially filled Or Killed”
>>> # or
>>> print deforders.TimeInForce().definitions[c.IOC]
>>> # all keys
>>> print deforders.TimeInForce().definitions.keys()
>>> ...
FOK = 'FOK'
GFD = 'GFD'
GTC = 'GTC'
GTD = 'GTD'
IOC = 'IOC'
__getitem__(definitionID)

return description for definitionID.

definitions

readonly property holding definition dict.

class oandapyV20.definitions.orders.OrderType

Bases: object

Definition representation of OrderType

Definitions used in requests and responses. This class provides the ID and the description of the definitions.

>>> import oandapyV20.definitions.orders as deforders
>>> print deforders.OrderType.MARKET_IF_TOUCHED
MARKET_IF_TOUCHED
>>> c = deforders.OrderType()
>>> print c[c.MARKET_IF_TOUCHED]
A Market-if-touched Order
>>> # or
>>> print deforders.OrderType().definitions[c.MARKET_IF_TOUCHED]
>>> # all keys
>>> print deforders.OrderType().definitions.keys()
>>> ...
LIMIT = 'LIMIT'
MARKET = 'MARKET'
MARKET_IF_TOUCHED = 'MARKET_IF_TOUCHED'
STOP = 'STOP'
STOP_LOSS = 'STOP_LOSS'
TAKE_PROFIT = 'TAKE_PROFIT'
TRAILING_STOP_LOSS = 'TRAILING_STOP_LOSS'
__getitem__(definitionID)

return description for definitionID.

definitions

readonly property holding definition dict.

class oandapyV20.definitions.orders.OrderState

Bases: object

Definition representation of OrderState

Definitions used in requests and responses. This class provides the ID and the description of the definitions.

>>> import oandapyV20.definitions.orders as deforders
>>> print deforders.OrderState.CANCELLED
CANCELLED
>>> c = deforders.OrderState()
>>> print c[c.CANCELLED]
The Order has been cancelled
>>> # or
>>> print deforders.OrderState().definitions[c.CANCELLED]
>>> # all keys
>>> print deforders.OrderState().definitions.keys()
>>> ...
CANCELLED = 'CANCELLED'
FILLED = 'FILLED'
PENDING = 'PENDING'
TRIGGERED = 'TRIGGERED'
__getitem__(definitionID)

return description for definitionID.

definitions

readonly property holding definition dict.

class oandapyV20.definitions.orders.OrderPositionFill

Bases: object

Definition representation of OrderPositionFill

Definitions used in requests and responses. This class provides the ID and the description of the definitions.

>>> import oandapyV20.definitions.orders as deforders
>>> print deforders.OrderPositionFill.REDUCE_ONLY
REDUCE_ONLY
>>> c = deforders.OrderPositionFill()
>>> print c[c.REDUCE_ONLY]
When the Order is filled, only reduce an existing Position.
>>> # or
>>> print deforders.OrderPositionFill().definitions[c.REDUCE_ONLY]
>>> # all keys
>>> print deforders.OrderPositionFill().definitions.keys()
>>> ...
DEFAULT = 'DEFAULT'
OPEN_ONLY = 'OPEN_ONLY'
REDUCE_FIRST = 'REDUCE_FIRST'
REDUCE_ONLY = 'REDUCE_ONLY'
__getitem__(definitionID)

return description for definitionID.

definitions

readonly property holding definition dict.