• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New Optimizer Type: Annualized Daily Sharpe Ratio for NT7

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

    New Optimizer Type: Annualized Daily Sharpe Ratio for NT7

    Hey all,

    Here is a new optimizer type for calculating the annualized daily Sharpe ratio on NT7. The Sharpe ratio included in NT is the monthly sharpe ratio, which is a decent measure if you are optimizing a strategy over several years, but if you only optimize a strategy over 3 years, then you only have 36 data points, which leads to somewhat meaningless stats.

    Therefore, I created a metric based on daily returns which yields more data points. I somewhat arbitrarily chose 100 trades to be the minimum amount of trades under which the daily sharpe ratio just gets set to 0 (for lack of data/reliability). Feel free to change this if you want a different threshold.

    I also annualized the sharpe ratio by multiplying by sqrt(252) - this is often done in industry. I did not factor in the risk-free rate.

    To add this optimizer type, copy the file (.cs file) to:
    "Documents/Ninjatrader 7/bin/Custom/Type".

    Then, just compile any random strategy (press F5 or click all the way through the wizard) and then you should be able to select it when optimizing. It is called "Daily Sharpe Ratio" in the "optimize on..." field.

    Please let me know if you find any problems with the code or if you have any questions. I have not had any issues thus far and take no responsibility if something goes wrong (don't see why it would). I also double checked the results in excel. There is a slight difference between the two results, probably due to rounding, but it isn't significant.

    Cheers
    Attached Files

    #2
    Excellent. Thanks for sharing, pmorissette!
    Ryan MNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sdauteuil, Today, 10:22 AM
    0 responses
    1 view
    0 likes
    Last Post sdauteuil  
    Started by pjsmith, Today, 09:48 AM
    1 response
    10 views
    0 likes
    Last Post Alfred
    by Alfred
     
    Started by bc24fl, Today, 10:03 AM
    0 responses
    10 views
    0 likes
    Last Post bc24fl
    by bc24fl
     
    Started by Trader17, Yesterday, 07:50 PM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by ct_fx, Today, 05:14 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Working...
    X