Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Maximizing the Order quantity

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

    Maximizing the Order quantity

    Hello,

    I was wondering if there is a way to tell a strategy to always use the maximum order quantity possible each time it does a trade?

    Thank you!

    Francis

    #2
    fladou246, the question would be more like from what that order qty amount was derived I think. From the UI we have an option to calculate that size ByAccountSize for example, you can pass in your available equity for this script and based on the margins defined for this instrument -> it will calculate the max amount to use then.

    Comment


      #3
      Hey,

      Ok, I tried it and Backtested it but it does not take in consideration profit . For example, if I put :
      {
      AccountSize = 4000;
      }
      , it will always enter with order quantity = 4 with the backtest Even if I made profit and my account is at 8000$. Would it take profit in consideration in realtime trading?

      Also, I have Interactive broker for API and the margin for the instrument I tested is aproxmatly 3500$ for 1 order (with Interactive broker) but ninja seems (in the backtesting) to give a margin of 1000$ per contract. When Ill test in realtime my order will probably be rejected?

      thank you very much

      Francis

      Comment


        #4
        Francis, correctly observed it would not cumulate profits in, it provides a means to calculate size by a specified fixed account size. If you want to work with higher margins you can set them as desired via the Instrument Manager master instrument definitions.

        What you can do for realtime is accessing the actual value of your traded to account via GetAccountValue() and use it for calculating an order size for your entries.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        68 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        39 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X