OPEN-SOURCE SCRIPT

2 Asset Optimal Portfolio

94
This script calculates and plots either the Sharpe Ratio or Sortino Ratio for a two-asset portfolio using historical price data, allowing users to analyse how different allocations affect portfolio performance over a specified lookback period.

Features:
Determine the weights of 2 assets and how they affect the the Sharpe or Sortino ratio.
Adjust timeframe to suit your personal investment timeframe.

User Inputs:
1. Asset 1 and Asset 2: Choose any two symbols to evaluate (default is BTCUSD for both).
2. Look Back Length: Number of past bars (days) to use for calculations (default is 365).
3. Source: Price source for returns (default is close).
4. Ratio: Select which ratio to plot — Sharpe or Sortino.
5. % of Asset 1: Portfolio weight (from 0 to 1) for Asset 1.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.