Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sharpe ratio, downside risk calculation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sharpe ratio, downside risk calculation

    Dear Support !

    1)
    I am trying to understand the TradeCollection class, but I am having difficulties and I
    am doing something wrong. Unfortunately I could not figure out the problem...

    I added the following to a strategy :

    protected override void OnTermination()
    {
    double sharpe= Performance.AllTrades.TradesPerformance.Percent.Av gProfit / Performance.AllTrades.TradesPerformance.Percent.St dDev;
    Print("Calculated Sharpe "+sharpe+" Sharpe "+Performance.AllTrades.TradesPerformance.SharpeRa tio);
    }

    The result of my calculation differs form the built-in SharpeRatio.
    What is wrong with my sharpe calculation ? How can I correct it ?

    2)

    I would also like to calculate the downside risk ( http://en.wikipedia.org/wiki/Downside_risk ).

    I am not sure if the below statement is correct:
    Performance.AllTrades.LosingTrades.TradesPerforman ce.Percent.StdDev

    How can I calculate the downside risk ?

    Thank you for the help,
    Arnold

    #2
    Hello Arnold,

    1. You would want to use the "Profit Per Month" as part of your calculations instead of "AvgProfit". For a formula to calculate Sharpe Ratio you may view our Help Guide at the following link.




    2. As far as the "Downside Risk", I am not familiar with this but looking at the link that you posted it would have to be manually calculated. With that said, I will also forward this to our development team for consideration on the next major release.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    66 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X