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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    65 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Working...
    X