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 CarlTrading, 03-31-2026, 09:41 PM
              1 response
              157 views
              1 like
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              91 views
              1 like
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              143 views
              2 likes
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              130 views
              1 like
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              107 views
              0 likes
              Last Post CarlTrading  
              Working...
              X