TechnicusCapital

Metrics using Alternative Portfolio Theory

Library "APT_Metrics"
Portfolio metrics using alternative portfolio theory

metrics(init, cur, start, end, alpha)
  Calculates APT metrics
  Parameters:
    init (float): Starting Equity (strategy.initial)
    cur (float)
    start (int): Start date (UNIX)
    end (int): End Date (UNIX)
    alpha (float): Confidence interval for DaR/CDaR. Defval = 0.05
  Returns: Plots table with APT metrics

The metrics are shown in the bottom pane being applied to a buy-and-hold strategy.

PLEASE NOTE: This is the first draft of the library. Some calculations may be incorrect. If you spot any mistakes then please let me know and I will correct them as soon as possible. I am also open to suggestions on how to improve this.

At the moment this only works on the daily timeframe until I can find a way to universally calculate annualized volatility.

Bibliothèque Pine

Dans le véritable esprit de TradingView, l'auteur a publié ce code Pine en tant que bibliothèque open-source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur ! Vous pouvez utiliser cette bibliothèque à titre privé ou dans d'autres publications open-source, mais la réutilisation de ce code dans une publication est régie par notre Règlement.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser cette bibliothèque?

Copiez le texte dans le presse-papiers et collez-le dans votre script.