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 Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,788 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        837 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,293 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        12 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        62 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X