TradingView
RedKTrader
2021年5月6日晚上6點20分

Tutorial: How I Track a stock portfolio on TradingView 教育

MSFT*100+AAPL*200+INTC*300+10000NASDAQ

描述

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.

tradingview.com/script/U8imfw8n-RedK-Portfolio-Tracker-v2-few-enhancements-and-display-options/

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!

評論

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.

評論

thanks to the TV team for helping me fix the table - now it shows properly. TV team, you guys rock (as always)!
評論
mused_Aurorah
RedKTrader
@mused_Aurorah, thank you !
scheplick
Fantastic. And I need to try some of this myself
RedKTrader
@scheplick, thank you S :)
JM-Trader
Still don't understand why TradingView doesn't provide a better tool to keep track of P&L all buy & sells on chart. What I want most
colesonx
@JM-Trader, You can always suggest it on their reddit! They have been very responsive to some of my requests which I really appreciate as a customer :)
mgiuliani
Well, that's an interesting idea. Thanks for sharing.
wks1121
Great content!

May I know what should I do with multiple currencies? e.g. I am holding some USD, GBP and JPY. What should I input in the table / the formula?

Thanks in advance :)
RedKTrader
@wks1121, the "formulas" shouldn't change - it's about what symbols to use

with that said, sorry if i don't know how this may work for currencies - this was meant for a stock portfolio - maybe someone can test it in other areas and share findings ??
vitleysingur
I think it is no longer possible to chart a portfolio like that. When I add the symbols in my watchlist and click on that item - it just shows me the chart for the first asset. Can you confirm if this is the same for you?
更多