Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order quantities not in sync with Strategy

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

    Order quantities not in sync with Strategy

    NinjaTrader Support, I have my order quantities explicitly defined in my strategy, however I am getting executions of 3 contracts when my strategy only indicates 2. I have the order quantity defined to be handled by the strategy but for some reason it still doesn't stay in sync. Please see my code and order executions attached:
    Attached Files
    Last edited by omermirza; 08-07-2024, 08:29 AM.

    #2
    Hello omermirza,

    The conditions you have shown are all individual conditions, in the situation where multiple conditions become true in the same update that could cause what you are seeing. You could also see additional positions if you have specified a higher entries per direction, that will allow additional entries into the same direction if one of your conditions to enter becomes true after the other had already become true.

    Comment


      #3
      Hi Jesse, How can multiple conditions become True if I'm only entering when the Market Position is Flat? -Omer

      Comment


        #4
        Hello omermirza,

        The position does not update until the next OnBarUpdate event, if those conditions become true within the same event that could lead to multiple positions. You would need to use Prints to see if that is happening.

        Comment


          #5
          Im not sure I follow - the strategy is set to calcuate OnBarClose. Can you give me a hypothetical example?

          Comment


            #6
            Hello omermirza,

            Your conditions are execution from top to bottom so every condition you have in the image will be checked in a single OnBarUpdate event. If any of those conditions become true within that same event they will submit orders because the position is still flat within that one event. To find out if that is happening you can use Print statements in your conditions to verify they are not becoming true within the same event.

            Comment


              #7
              But If I'm specifying the quantity I still don't see how I can get more than 2 contracts. There is only one entry order.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CarlTrading, 03-31-2026, 09:41 PM
              1 response
              81 views
              1 like
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              42 views
              0 likes
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              64 views
              2 likes
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              66 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              54 views
              0 likes
              Last Post CarlTrading  
              Working...
              X