OPEN-SOURCE SCRIPT

2 Asset Optimal Portfolio

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

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.