Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change order size when sharp ratio is above 1.5

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

    Change order size when sharp ratio is above 1.5

    how can i tell ninjatrader to trade 2 contracts when the sharp ratio for the strategy is above 0.5 and trade only 1 contract when its bellow 0.5
    Last edited by wallsteetking; 04-03-2014, 08:58 PM.

    #2
    wallstreetking, you could access the SharpeRatio in NinjaScript and therefore adjust the qty used in your Enter() calls accordingly - http://www.ninjatrader.com/support/h...harperatio.htm

    The call above is using a zero risk free return, if you wish to supply a custom one, use this call -

    BertrandNinjaTrader Customer Service

    Comment


      #3
      This is what I have so far. The issue I have is, I have no idea how to tell ninjatrader to go long 2 CONTRACTS when sharp ratio is above .4 and trade only 1 contract when its bellow 0.4.Can you please guide/help me on the right direction. Furthemore, this has multiple strategies running at the same time, thats why I have Strat1.....etc on here.

      Important: when i run the strategy with 1000 days back i get 500 trades but when i run the strategy with 6000 days back i get only 80 trades executed????? What going on?
      Code:
      if ((Strat1 + Strat2 + Strat3 + Strat4 + Strat5>= myInt) Bars.BarsSinceSession <=150 && Bars.BarsSinceSession >=1 && [COLOR="Blue"][B]P[B]erformance.AllTrades.Count >= 1 && Performance.AllTrades.TradesPerformance.SharpeRatio >= 0.4[/B] )
      
      {	
      EnterLong(DefaultQuantity, "");
      }[/B][/COLOR]

      Comment


        #4
        Correct, right now you just use the DefaultQuantity as your quantity in the EnterLong call, you would need to make that conditional based on the outcome you get from the SharpeRatio call. Either use your own qty variable that changes depending on the sharpe or multiply your DefaultQuantity then by 2 for situations where it's > 0.4.

        As for the different trade groupings you see in backtesting, would not know - I would suggest to isolate out and run for example a single strategy only and checking out when the issue would be thrown exactly so you can fix.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Aviram Y, Today, 05:29 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by cls71, Today, 04:45 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by TradeForge, Today, 02:09 AM
        1 response
        22 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by elirion, Today, 01:36 AM
        2 responses
        14 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by DJ888, 04-16-2024, 06:09 PM
        5 responses
        14 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X