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.

Biblioteca Pine

Siguiendo el verdadero espíritu de TradingView, el autor de este código de Pine lo ha publicado como biblioteca de código abierto, para que el resto de programadores de Pine de esta comunidad puedan volver a utilizarlo. ¡Un hurra por el autor! Puede utilizar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero debe ceñirse a lo establecido en las Normas internas.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar esta biblioteca?

Copie la siguiente línea y péguela en su script.