Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Money Management Alghtms.

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

    Money Management Alghtms.

    Hi all,

    I'm looking for some money management algorithms like Kelly-F, Optimal-F, Secure-F, etc.

    I'd search in the forum, and Id find a Kelly-F post (http://www.ninjatrader-support2.com/...ight=magicboiz), but nothing else...... do you know if anybody using NT has developed these algorithms?

    Regards

    #2
    Hi magicboiz,

    I am not aware of any released publicly on our forums, but you can check the file sharing section to see if you find anything suitable.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      Hi magicboiz,

      I am not aware of any released publicly on our forums, but you can check the file sharing section to see if you find anything suitable.
      I usually export the Win/Loss ratio and Pcnt Profitable to an excel spreadsheet and calculate Kelly Statistic there. It's defined simply as:

      P-Q/W where P = Percent Probability of Profit, Q = (1-P) or Percent Probability of Loss, and W is the Win Size/Loss Size Ratio.

      Optimal F can't be done with a simple formula. It's a brute force approach iterating over all trades for all potential value of optimal f until the optimum value is found. Once again, I do it in a separate Excel spreadsheet from the trades list. It would be possible to do in NT but the effort is probably not worth it.

      I find that the Kelly statistic is generally more conservative than optimal F, so I just use Kelly as a simple "goodness" measure.

      Comment


        #4
        Thanks for the valuable input Peter!

        Comment


          #5
          Kelly Realtime

          I'm trying to calculate Kelly realtime but everytime my code gets to the calculation it freezes and I can't figure out why. It compiles fine but I think it's running into something strange I'm not a good enough programmer to figure out...or it's simple and I just need someone to give me a wake up call... here it is

          if(Performance.AllTrades.LosingTrades.Count > 10 && Performance.AllTrades.WinningTrades.Count > 10)
          {

          avgwin = Convert.ToDouble(Performance.AllTrades.WinningTrad es.TradesPerformance.Currency) / Convert.ToDouble(Performance.AllTrades.WinningTrad es.Count);
          avgloss = Convert.ToDouble(Performance.AllTrades.LosingTrade s.TradesPerformance.Currency) / Convert.ToDouble(Performance.AllTrades.LosingTrade s.Count);
          winpct = Convert.ToDouble(Performance.AllTrades.WinningTrad es.Count) / Convert.ToDouble(Performance.AllTrades.Count);
          wlratio = avgwin / avgloss;
          kelly = winpct - ((
          1-winpct)/wlratio);
          Print(
          "Kelly = ");
          Print(kelly);
          }

          Thanks,

          Shiptastic

          Comment


            #6
            oh and those spaces that are showing up on what I pasted aren't there in the actual code...

            Comment


              #7
              You can cast to double just by doing (double).

              (double) someVariable

              Other than that you will just need to add Print functions into your code to figure out which line is causing problems. Then go from there to fixing it.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                I'm surprised you didn't catch it. I figured out what I was doing wrong.

                The actual call I should of been using was:

                Performance.AllTrades.WinningTrades.TradesPerforma nce.GrossProfit

                Not "".Currency

                I like the trick with the (double) though, that's nice.

                Comment


                  #9
                  shiptastic,

                  Glad you got it resolved.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  566 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  330 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  547 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  548 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X