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 Brevo, Today, 01:45 AM
              0 responses
              3 views
              0 likes
              Last Post Brevo
              by Brevo
               
              Started by aussugardefender, Today, 01:07 AM
              0 responses
              3 views
              0 likes
              Last Post aussugardefender  
              Started by pvincent, 06-23-2022, 12:53 PM
              14 responses
              239 views
              0 likes
              Last Post Nyman
              by Nyman
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              9 responses
              384 views
              1 like
              Last Post Gavini
              by Gavini
               
              Started by oviejo, Today, 12:28 AM
              0 responses
              6 views
              0 likes
              Last Post oviejo
              by oviejo
               
              Working...
              X