Tutorial: How I Track a stock portfolio on TradingView

For those of us who like to leverage the awesome charting capabilities of TradingView to visualize, analyze and track a portfolio of holdings, i wanted to share couple of ways i have been using in the past few months.

I found that the ability to "chart" a portfolio adds a whole new dimension to my decision making - that looking at the portfolio in numbers on daily basis does not allow. for example, when I'm able to "chart" the portfolio, i can apply simple technical analysis tools (Moving Averages, MACD ..etc) to find new "portfolio opportunities" - like for example, when the portfolio is at a top with a possible upcoming decline in value, that would be a good time to start cashing out and locking some of my unrealized profits, or to hedge by buying some Puts or selling some Covered Calls.. as in the example in the chart above.

so here the ways i use to track my portfolio using TradingView.

Method 1: Using a Pine script
- few weeks ago i published a simple Portfolio Tracker script with details on how it can be used to set up and track a simple portfolio of 10 holdings + a cash position. please refer to the link below if you're interested in that method.

Method 2: Using TradingView's Watchlist
- i'd like to focus on this method in this post. there are few variations to how this can be accomplished, and i hope i can share a trick or 2 that i have been using that made this a lot easier for me

1 - the simplest way: add the "portfolio string" manually as a watchlist symbol

assume i have a simple portfolio of 100 MSFT + 200 AAPL + 300 INTC along with some $10,000 cash in the account
i chose to add a new symbol to my watchlist, and enter the line below - this is what i refer to as the "portfolio string":

MSFT * 100 + AAPL * 200 + INTC * 300 + 10,000

and this is what you see in the chart here..

this should work well - the only issue with this method is that if my portfolio is more complex than 3-4 positions, and/or if it changes frequently due my active trading, this manual approach is less than ideal

2 - what if my portfolio is more complex than this and it changes often

in that case, i would suggest to use a spreadsheet - or maybe you already maintain a sheet where you track your trades.
in that sheet, construct a table like the below and enter the formulas that are shown in the "formula view"

in that sheet, cell D2 , will consolidate (using the concatenation function) the individual "Position Strings" into a single "Portfolio String"
you can then copy cell D2 from the Excel table, then go to TradingView, choose to add a symbol to your watchlist, and simply paste that "Portfolio String" in there.. and voila!

-- adjust the number of rows as needed (add rows, and update the formula in cell D2). i tried with more than 10 positions per portfolio and it works smoothly
-- note that the "Position_Str" formula is consistent for all holdings *except* for the last line
-- if you're using something other than Excel, please map the functions accordingly. the below works on Excel.

Formula View = what we enter in the spreadsheet
	A	B		C				D
1 	Symbol 	Qty 		Position_str 			Portfolio_str
2 	sym1 	100 		= A2 & "*" & B2 & "+" 		=CONCAT(C2:C5)
3 	sym2 	200 		= A3 & "*" & B3 & "+"
4 	sym3 	300 		= A4 & "*" & B4 & "+"
5 	Cash 	10,000 	 	= B5

Normal Table (results) View
	A	B		C				D
1 	Symbol 	Qty 		Position_str 			Portfolio_str
2 	sym1 	100 		MSFT*2000+ 			MSFT*2000+AAPL*3000+INTC*3000+10000
3 	sym2 	200 		AAPL*3000+	
4 	sym3 	300 		INTC*3000+
5 	Cash 	10,000 	 	10,000

3 - My last tip here is not a separate approach - but builds on the one above
- i already use a separate spreadsheet table (a trade log) to track my trades which i update on regular basis.
- using the pivot table feature, i can construct a view of my "trade log" that provides what we see in Columns A and B above.
- so this makes it easy to just "refresh" the pivot table once i update my trades, and the "Portfolio String" will be updated automatically for me - theni will just copy and paste it as a new symbol in my TradingView WatchList and remove the older ones.

i hope some of you find these tips useful and can leverage some of this to open up that new portfolio management abilities to your trading..

Feedback and comments are welcome as usual - best of luck!

Comment: i'm sorry that my tables were distorted after publishing - it seems the publishing engine removes the tabs and spaces. but i hope readers will still get the idea and leverage the example.
Comment: thanks to the TV team for helping me fix the table - now it shows properly. TV team, you guys rock (as always)!

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.