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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X