Skip to main content

Position

Position object represents a single company ticker (symbol) currently in the grid. An instance can be retrieved from a grid by calling the get() method of Positions interface. Similarily, a symbols (tickers) can be inserted into the grid either manually (via the UI) or by using Positions.add('<symbol>') function of Positions interface.

Accessible fields#

FieldField typeDescription
currentPriceNumberThe price of the last trade
bidNumberMost recent bid price
bidSizeNumberThe size of the bid side
bidTimeNumberThe timestamp of the bid side
askNumberMost recent Ask price
askSizeNumberThe size of the ask side
askTimeNumberThe timestamp of the ask side
avgEnterPriceNumberAvergage entry price
costBasisNumberTotal cost basis
marketValueNumberMost recent market value of the entire position
descriptionStringcompany description
openPriceNumberday’s open price
highPriceNumberthe high price of the day
lowPriceNumberday’s low price
closePriceNumberday’s close price (at market close)
prevClosePriceNumberyesterday’s close price
rsi Numberthe current RSI value
ma50 Number
ma200Number

Sample code#

//retrieve a current price from the grid
var AMC = Positions.get("AMC");
// Now we can test and apply some logic according to the current state of AMC
if (AMC !== null) {
Alert.info("AMC current price: $" + AMC.currentPrice);
}