Positions
Represents a collection of positions in the grid. It is used to manage a collection of stocks (or cryptocurrencies) that we're interested in tracking. Tickers can be retrieved, added, and removed tickers from the grid using either the UI or programmatically (as shown below).
#
Positions.allRetrieve a list containing all instances of Position objects currently in the grid. Useful when there is a need to iterate through all items currently in the grid.
var tickers = Positions.all();
#
Return valueResult | Result value |
---|---|
on success | an array of Position objects |
on error | an empty array |
#
Sample codeThe code snippet below retrieves all Position instances currently in the grid and dumps it current price to the log.
- JavaScript
- Python
The code below iterates and processes all tickers in the grid except for SPCE. Notice the use of 'return' rather than 'continue', which is due to the fact that this code fragment is within an anonymous function.
- JavaScript
- Python