Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position.Quantity issue

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

    Position.Quantity issue

    HI
    I would like some guidance.
    I have a strategy that places mouse click trades.
    All works fine and it's unmanaged.
    However I recently noticed that if i click say 1 lot and then change the value on the chart order itself to say 2 - 2 get filled but my strategy reports Position.Quantity as 1. And this causes havoc in my strategy with lots of obj instance errors, etc.
    Can you tell me what I am missing and how to report this correctly to my strategy.
    PS I would prefer not to use Managed as there are certain things managed does "wrong" for me.
    thank you

    #2
    Hello Mindset,

    Are the orders being submitted with strategy order methods (SubmitOrderUnmanaged())?

    Or are the orders being submitted with Account.Submit() or AtmStrategyCreate()?

    Are you testing the strategy using the Sim101 account?

    Please print the order.ToString() in OnOrderUpdate() and print the position.ToString() in OnPositionUpdate(). If there are other prints already added to the script, please temporarily comment these out.

    Re-run the script, save the output from the output window (right-click the output window > select Save as) and attach the .txt file to your next post.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Apologies for the delay in response.
      I established that Position.Quantity was only reporting the strategy position and not the account position - as per your help files.
      So I gave myself a variable to report the actual account position size ( which on occassions can be different) in OnPositionUpdate and now reference that for my orders - I assume this is the right place to put it?

      Comment


        #4
        Hello Mindset,

        That is correct the Position is the Strategy position. PositionAccount is the account position.

        OnPositionUpdate() would be when the strategy position updates.

        An event handler method added to the <Account>.PositionUpdate event would update when the account position updates.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        87 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        128 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        65 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        117 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        67 views
        0 likes
        Last Post PaulMohn  
        Working...
        X