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 do Pine

No verdadeiro espírito TradingView, o autor publicou este código de Pine como uma biblioteca de código aberto para que outros programadores de Pine de nossa comunidade possam reutilizá-lo. Um brinde ao autor! Você pode usar esta biblioteca em particular ou em outras publicações de código aberto, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Gostaria de usar essa biblioteca?

Copie a seguinte linha e cole-a em seu script.