Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Max Position Size and Order Question

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

    Max Position Size and Order Question

    For NT7 I have 2 questions.

    1. In my strategy I'm using SetProfitTarget() to exit trades. If I'm using continuum data feed with NinjaTrader Brokerage, does this limit order rest on the brokerage servers or is it in the queue at the exchange?

    2. Is there a way to limit the total contracts the strategy can trade programmatically and that can't be overridden by the Order Properties Default Quantity in the edit strategy box.

    Thanks

    #2
    Hello superhaze421,

    Thank you for writing in.

    Please take a look at this particular forum post for more information about where orders reside depending on the order's state and the connection type used: http://ninjatrader.com/support/forum...ead.php?t=5349

    When submitting your orders (such as with EnterLong(), EnterShort(), etc.), you can programmatically modify the amount of contracts submitted.

    For example, if you use:
    Code:
    EnterLong(5);
    This code will send a long order for five contracts. This behavior cannot be modified unless the hard-coded value is modified from within the code itself.

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      I did hard code the size using EnterLong(5, "signal");
      But if I load the strategy and under Order properties use "Set order quantity" to "by default quantity" and set 10 contracts for example it overrides the 5 that I programed. Just want it to limit # of contracts so users cant go above a certain # of contracts.

      Comment


        #4
        Hello superhaze421,

        Thank you for the clarification. It looks like I have misread your initial inquiry.

        You would be able to programmatically override this by checking and modifying the DefaultQuantity property: https://ninjatrader.com/support/help...ltquantity.htm

        As an example:
        Code:
        // if DefaultQuantity is more than 5, set DefaultQuantity to 5
        if (DefaultQuantity > 5)
             DefaultQuantity = 5;
        Please, let us know if we may be of further assistance.
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          That works, thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          77 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          45 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          27 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          62 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X