Position Information
Last updated
Last updated
Adjusts a virtual bot position by processing a simulated order using the defined specifications. Works similarly to PlaceExitLongOrder/PlaceExitShortOrder, but will NOT create a real order; only simulated!
Syntax: AdjustVPosition(price, amount, [ positionId ])
Return type: Void
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Closes a virtual bot position entirely by processing a simulated order using the defined specifications. Works similarly to DoExitPosition and PlaceExitPositionOrder, but will NOT create a real order; only simulated! Use this to "clean up" bot positions if required.
Syntax: CloseVPosition(price, [ positionId ])
Return type: Void
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Creates a bot position by processing a simulated order using the defined specifications. By doing this, profit/loss and position details can be used by the script. Use the returned position ID with PositionContainer() to extract position data.
Syntax: CreatePosition(direction, price, amount, [ market ], [ leverage ], [ positionId ])
Returns the position ID.
Return type: String
Gets all open positions and returns them as PositionContainers.
Syntax: GetAllOpenPositions()
Returns an array of PositionContainers.
Return type: Dynamic
Gets the total amount open in a specific position.
Syntax: GetPositionAmount([ positionId ])
Returns the total amount open in a specific position.
Return type: Number
Gets the direction of a specific position.
Syntax: GetPositionDirection([ positionId ])
Returns PositionLong, PositionShort or NoPosition.
Return type: Enum
Gets the average enter price of an open position.
Syntax: GetPositionEnterPrice([ positionId ], [ includeClosed ])
Returns the average enter price.
Return type: Number
Gets the market of an open position.
Syntax: GetPositionMarket([ positionId ])
Returns the account, market & leverage as a single string.
Return type: String
Gets the total realized plus unrealized profit of a specific position.
Syntax: GetPositionProfit([ positionId ], [ targetPrice ])
Returns the total realized plus unrealized profit of a specific position. On spot/margin the result will be in the quote currency. For leverage its in the underlying currency.
Return type: Number
Calculates the ROI based on used margin and unrealized + realized profits.
Syntax: GetPositionROI([ positionId ], [ targetPrice ])
Returns the ROI as a percentage.
Return type: Number
Checks whether or not a position is closed.
Syntax: IsPositionClosed([ positionId ])
Returns true if position is closed, otherwise false.
Return type: Boolean
Gets the total amount open in a long position.
Syntax: LongAmount([ market ])
Returns the total amount open in a long position.
Return type: Number
Gets all the information from the open bot position.
Syntax: PositionContainer([ positionId ], [ includeClosed ])
Returns an array with position information.
Return type: Dynamic
Gets the total amount open in a short position.
Syntax: ShortAmount([ market ])
Returns the total amount open in a short position.
Return type: Number
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
Parameter Name | Parameter Type | Required | Suggestions |
---|---|---|---|
price
Number
True
Number,UserPositionContainer
amount
Number
True
Number,UserPositionContainer
positionId
String
False
NewGuid,Text,Load
price
Number
True
Number,UserPositionContainer
positionId
String
False
NewGuid,Text,Load
direction
Enum
True
PositionLong,PositionShort
price
Number
True
Number,UserPositionContainer
amount
Number
True
Number,UserPositionContainer,MaxExitLongAmount,MaxExitShortAmount
market
String
False
InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket
leverage
Number
False
Input,Number,Leverage
positionId
String
False
NewGuid,Text,Load
positionId
String
False
Load
positionId
String
False
Load
positionId
String
False
Load
includeClosed
Boolean
False
True,IsTrue,False,IsFalse,Or,Branch,Equals,IsBiggerThan,IsSmallerThan,IsBiggerOrSmallerThan,IsAnyOrderOpen,IsOrderFilled,IsOrderOpen,IsTradeAmountEnough
positionId
String
False
Load
positionId
String
False
Load
targetPrice
Number
False
GetBuyPrices,GetSellPrices,GetOpenPrices,GetHighPrices,GetLowPrices,GetClosePrices,GetHighLowPrices,GetHighLowClosePrices,GetOpenClosePrices,GetOpenHighLowClosePrices,GetBodyHighPrices,GetBodyLowPrices
positionId
String
False
Load
targetPrice
Number
False
GetBuyPrices,GetSellPrices,GetOpenPrices,GetHighPrices,GetLowPrices,GetClosePrices,GetHighLowPrices,GetHighLowClosePrices,GetOpenClosePrices,GetOpenHighLowClosePrices,GetBodyHighPrices,GetBodyLowPrices
positionId
String
False
Load
market
String
False
InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket
positionId
String
False
Load
includeClosed
Boolean
False
True,IsTrue,False,IsFalse,Or,Branch,Equals,IsBiggerThan,IsSmallerThan,IsBiggerOrSmallerThan,IsAnyOrderOpen,IsOrderFilled,IsOrderOpen,IsTradeAmountEnough
market
String
False
InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket