Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Money management code

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

    Money management code

    There doesn't appear to be much MM code (that I can find). Does anyone have a source of code snippets on MM or examples?
    There is a lot of Mq4 developmentt, but none that is converted.
    My stab in the dark is that it uses the RealizedPnL command to access trade history. - but I'm so green to ninjatrader it's humiliating
    I'm specifically interested in using % of capital per trade. eg 2%.

    Frankly I'm surprised I can't find anything, MM is critical to automating any strategy.

    Regards
    Paul.

    #2
    I don't think that NT has any methods to access the size of your portfolio. If you don't want to hack around it using Strategy parameters, you could hack around it by making an API call directly to your broker (if it is supported). This won't help you in backtesting, more's the pity.

    Comment


      #3
      Please see this reference sample. It may shed some light as to what you are looking for: http://www.ninjatrader-support.com/v...ead.php?t=4084
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Thank you Josh, I did go through this sample before posting. It is very useful but I'm just surprised there isn't more code like this around.

        Comment


          #5
          Unfortunately that is the only reference we have available at this time. You can review small code snippets in the Help Guide too. Search for the Trades object.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            I am surprised that NT requires an external tool to handle money management.

            Comment


              #7
              Originally posted by GPEngine View Post
              I am surprised that NT requires an external tool to handle money management.
              No 3rd Party tool is required: you simply have to write you own money management code if you so wish, though I do use a little standalone utility that I wrote, outside of NT, to do those calculations for me, simply because that gives me better control of the data that I feed into the tool.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, Yesterday, 10:06 AM
              0 responses
              20 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              18 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              14 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              9 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              38 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X