OPEN-SOURCE SCRIPT

2 Asset Optimal Portfolio

134
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.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.