Print Page  
OTHER HOLDINGS & OPINIONS
PortfolioOpenBar(id1[, .., id10])
Full Description

Account(id1[, .., id10])
AccountClose(id1[, .., id10])
AccountCloseBar(id1[, .., id10])
AccountOpen(id1[, .., id10])
AccountOpenBar(id1[, .., id10])

Similar syntax for Portfolio & Watchlist

With these functions you can query different statistics of stocks you transacted in accounts or strategies (either from the Invest or Research section) or added to or took out of watchlists. You can specify up to 10 accounts or strategies or watchlists using their unique id (which you will see in the browser URL) or their name in quotes.

NOTES:
  • These functions are point in time and will work as expected in the past
  • Only strategies, accounts and watchlists owned by you can be used as parameters
  • Please see "Nested Usage" below for information on the order in which automated strategies are rebalanced
  • If your account holds both ETFs and Stocks you will only see one or the other depending if the screen is for ETFs or Stocks.
Examples

To generate a screen report with all the stocks in my account that are in the screen universe use this rule

Account("My account")

To see which stock you have held for over 6 months (approx 125 trading days) and are losing more than 20% enter these rules. Note that we use bars (trading days) instead of calendar days because the function Ret%Chg(bars) uses them.

SetVar(@bar,AccountOpenBar("My account")
@bar>125 and Ret%Chg(@bar) < -20

Nested Usage

If you are using these functions in strategies to exclude stocks owned in other strategies the rebalance order of automated strategies needs to be taken into account. The order for automated strategies is as follows:

1) All Designer Models are rebalanced in alphabetical order, A-Z, case insensitive.
2) All Strategies are rebalanced in alphabetical order, A-Z, case insensitive.
3) All Books are rebalanced, alphabetical order, A-Z, case insensitive.