Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Correcting my Strategy position versus Global account position

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

    Correcting my Strategy position versus Global account position

    Hi. I have that Custom Strategy and, for now, it is launched (or attached) to a Chart. I'd really really like to implement it
    within the NinjaTrader AddOn class hierarchy but, for now I'm delaying that big chunk of work.

    When my Strategy thinks it's FLAT; but the true Global position says I've still got an open position; I'd like to
    correct that. (this should be fairly rare)

    What's the easiest way for me to make that (rare) correction in my Global position; *without* causing my Strategy to be
    terminated?

    When I do a "manual" correction on the NinjaTrader platform to close all Account Positions, it then Terminates my
    running Strategy; and that is what I'd like to avoid, of course.

    I think there are some AddOn-hierarchy-related calls that may yield the Global Account position; and I'd hope I can then execute some
    Buys or Sells in my Strategy to bring the Global position into line with what my Unmanaged Strategy believes it to be (without
    shutting me down).

    Thanks for pointing me in the right direction !!
    hyper

    #2
    Hello Hyper,

    Thanks for your post.

    "When my Strategy thinks it's FLAT; but the true Global position says I've still got an open position". Are you saying the strategy has an open account position and the strategy position shows that its flat (Seen in the strategies tab)?

    Or are you saying you have an open position on another instrument that you would like to close? (I'm confused by the use of "global" as I am unsure of the context.)



    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Yes, this is an Unmanaged Strategy; and it keeps track of a concept of "Position" which consists of an Entry order and a compensating
      Exit order. Possibly due a rare bug on my side; I may think that this collection of Positions is net FLAT.

      However, the NinjaTrader Account on the platform dashboard reveals that there may be an open position; that I'll need to neutralize.

      Hope that clarifies what's going on. Remember that this is fully Unmanaged; and so I handle all of the Order states.

      At any given time, I'm working many orders, but always on the same Futures Instrument, e.g. MNQ or NQ, in only a single Account.

      hyperscalper
      Last edited by Hyper; 05-25-2021, 03:19 PM.

      Comment


        #4
        Hello Hyper,

        Thanks for your reply.

        What data feed do you connect to?



        Paul H.NinjaTrader Customer Service

        Comment


          #5
          I use, and also analyze the full Rithmic Market Depth as my data feed.
          Event rates incoming are typically 25k events per minute, up to 50k-ish at burst peaks,
          so the whole Analytics side of things is more difficult than the Order Entry side.
          hyper

          Comment


            #6
            Perhaps I could use from the Strategy instance, something related to:

            Position[] positions = this.PositionsAccount; // where this is the Strategy instance

            And thusly, determine what correction I may need to do to my own accounting.

            hyper

            Comment


              #7
              Hello Hyper,

              Thanks for your reply.

              You could manually close the position by placing an opposite-side market order.

              When the position question occurs, does it only happen when you start the strategy? If so what is the strategy start-up behavior set to?

              What code are you currently using to pull the account position?

              Paul H.NinjaTrader Customer Service

              Comment


                #8
                You said: "You could manually close the position by placing an opposite-side market order."

                Yeah, that's exactly what I would do; but I just need to get the Account position(s) and do exactly that.

                Just wanting confirmation as to how I can get the "true", "global" Account positions, is what this post is all about...

                ...discrepancies between my accounting and the broker's accounting are very rare, over hundreds of trades...

                hyper

                Comment


                  #9
                  Hello Hyper,

                  Thanks for your reply.

                  You can use: https://ninjatrader.com/support/help...ns_account.htm

                  Paul H.NinjaTrader Customer Service

                  Comment


                    #10
                    Thank you for the info. I'll give it a shot; and report back when I observe the
                    issue, and whether that info allows me to correct it; without my Strategy being Terminated.

                    hyper

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by traderqz, Today, 12:06 AM
                    2 responses
                    3 views
                    0 likes
                    Last Post traderqz  
                    Started by RideMe, 04-07-2024, 04:54 PM
                    5 responses
                    28 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by f.saeidi, Today, 08:13 AM
                    1 response
                    7 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by DavidHP, Today, 07:56 AM
                    1 response
                    6 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Started by kujista, Today, 06:23 AM
                    3 responses
                    11 views
                    0 likes
                    Last Post kujista
                    by kujista
                     
                    Working...
                    X