SmartQuant Discussion
http://www.smartquant.com/forums/

Optimization using sharpe ratio as objective
http://www.smartquant.com/forums/viewtopic.php?f=86&t=14744
Page 1 of 1

Author:  azuric [ Thu Sep 14, 2017 10:24 am ]
Post subject:  Optimization using sharpe ratio as objective

How do you change the objective function to maximise the sharpe ratio instead of PnL in any optimizer?

Author:  skuvv [ Fri Sep 15, 2017 1:46 pm ]
Post subject:  Re: Optimization using sharpe ratio as objective

Hello azuric,
it will be look like this, code for strategy:
Code:
      public override double Objective()
      {
         var item = Portfolio.Statistics.Get(PortfolioStatisticsType.SharpeRatio);
         
         double result = 0;
         
         if (item != null)
            result = item.TotalValue;
         
         return result;
      }   


Attachment:
objective.png
objective.png [ 11.91 KiB | Viewed 215 times ]

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/