Position Information

Position Information

Every bit of information about the bots positions is available through the commands in the Position Information category. Each of the commands has an optional positionId. This parameter can be left empty for managed tranding and can be used but is not required for unmanaged. You can read more about that in the Position Handling page.

Position Containers

The command will return every important detail about the position.

GetPositionMarket

Will return the account and market associated with the position. The value can be used to place order or request other information about the account or market.

GetPositionDirection

Returns the current position direction constant. PositionLong, PositionShort or NoPosition. Can be used if the execution flow depends on a specific direction.

GetPositionAmount

Returns the current position amount. The amount is not reduced by open orders.

GetPositionEnterPrice

Returns the average enter price of the whole position.

GetPositionProfit

Returns the current unrealized + realized profit of the position.

GetPositionROI

Returns the current profit/loss ratio. When trading on cross margin, max leverage will be used for the calculation. For example, on BitMEX the roi of 1 contract a $1 is based on $0.01 (100x).

Position Prices

All the information about the current and last position enter and exit prices are available in the postion prices category. The command are pretty straight forward.

Last updated