Portfolio Composition maps

Source code Author Update time

using Plots
unicodeplots()

see: https://stackoverflow.com/a/37732384

using Random
Random.seed!(111)
tickers = ["IBM", "Google", "Apple", "Intel"]
(N, D) = (10, length(tickers))
weights = rand(N, D)
weights ./= sum(weights, dims = 2)
returns = sort!((1:N) + D * randn(N))
portfoliocomposition(weights, returns, labels = permutedims(tickers))
┌────────────────────────────────────────┐ 12.57 │⠀⡗⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⡖⠒⢖⠲⣖⠒⠒⠒⠒⠒⠒⠒⠒⠒⠒⢲⠀│ IBM │⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢣⠀⢸⠀⠀⠙⠢⢄⠀⠀⠀⠀⠀⠀⠀⢸⠀│ Google │⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣘⠄⣀⠇⠀⠀⠀⠀⠉⠢⡄⠀⠀⠀⠀⢸⠀│ Apple │⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⠤⠤⠒⠒⠉⣉⠤⠒⠉⠀⠀⠀⠀⠀⠀⠀⠀⠘⣄⠀⠀⠀⢸⠀│ Intel │⠀⡇⠀⠀⠀⠀⢀⣀⡠⠤⠒⠒⠉⠉⠀⠀⠀⣀⠤⠒⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢦⠀⠀⢸⠀│ │⠀⡇⠀⢰⠊⠉⠁⠀⠀⠀⠀⠀⢀⡠⠴⠒⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⠤⠤⠒⠃⠀⢸⠀│ │⠀⡇⠀⠧⢤⣀⠀⠀⠀⠠⠶⣏⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡤⠒⠒⠉⠉⠀⠀⠀⠀⠀⠀⠀⢸⠀│ │⠀⡇⠀⠀⠀⠀⠉⠑⠲⠤⣄⣀⠀⠉⠙⠒⠢⠤⣄⣀⠀⠀⠀⠀⣠⠎⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀│ │⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⡇⠀⠀⠀⠀⠀⠀⠉⠹⡄⠈⠓⠒⠦⠤⢄⣀⡀⠀⠀⠀⠀⠀⠀⠀⢸⠀│ │⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⣒⣒⣤⣤⡀⢸⠀│ │⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡢⠀⠀⠀⠀⠀⠀⠀⢸⠀⠤⠶⠶⢶⣒⣉⣉⣉⠉⠁⠀⠀⠀⠀⢸⠀│ │⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠁⠀⠀⠀⠀⠀⠀⠀⠉⠢⣀⠀⠀⠀⠀⠀⢀⠼⠋⠀⠀⠀⠀⠀⢸⠀│ │⣀⣇⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣇⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣈⣑⣄⣀⣠⣖⣁⣀⣀⣀⣀⣀⣀⣀⣸⣀│ │⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⠊⠀⠙⠲⢄⡀⠀⠀⠀⠀⠀⠀⢸⠀│ -2.21428 │⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠔⠁⠀⠀⠀⠀⠀⠀⠉⠲⠀⠀⠀⠀⠀⠸⠀│ └────────────────────────────────────────┘ ⠀-0.03⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀1.03⠀

This page was generated using DemoCards.jl and Literate.jl.