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.

ไลบรารีไพน์

จิตวิญญาณที่แท้จริงของ TradingView ผู้เขียนได้ตีพิมพ์รหัส Pine นี้เป็นไลบรารีโอเพนซอร์ซเพื่อให้โปรแกรมเมอร์คนอื่น ๆ จากชุมชนของเราสามารถนำไปใช้ซ้ำได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ไลบรารีนี้เป็นการส่วนตัวหรือในสิ่งพิมพ์โอเพนซอร์สอื่น ๆ แต่นำรหัสนี้มาใช้ซ้ำในสิ่งพิมพ์จะถูกควบคุมโดย กฎระเบียบการใช้งาน

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการใช้ไลบรารีนี้หรือไม่?

คัดลอกข้อความไปยังคลิปบอร์ดแล้ววางลงในสคริปต์ของคุณ