Skip to 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

Field Field type Description
currentPrice Number The price of the last trade
bid Number Most recent bid price
bidSize Number The size of the bid side
bidTime Number The timestamp of the bid side
ask Number Most recent Ask price
askSize Number The size of the ask side
askTime Number The timestamp of the ask side
avgEnterPrice Number Avergage entry price
costBasis Number Total cost basis
marketValue Number Most recent market value of the entire position
description String company description
openPrice Number day’s open price
highPrice Number the high price of the day
lowPrice Number day’s low price
closePrice Number day’s close price (at market close)
prevClosePrice Number yesterday’s close price
rsi Number the current RSI value
ma50 Number
ma200 Number

Sample code

# get a reference to a symbol we're tracking in the grid
AMC = Positions.get("AMC")

# Now we can test and apply some logic according to the current state of AMC
if not AMC is None:
  Alert.info("{} current price: ${}".format(item.symbol, item.currentPrice))
//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);
}