Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 bortz, 11-06-2023, 08:04 AM
              47 responses
              1,607 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              9 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              19 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              6 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              16 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X