Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Position value

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

    Market Position value

    I am occasionally running into a problem where I cancel an order or it gets filled and then I check the MarketPosition value and it is not accurate. I am using IB. It seems it becomes up to date after an event in the log with a category of "Position" occurs. The Position update I am looking at in my log right now took 24 seconds from when the order was filled. Is that your understanding that the MarketPosition will not be accurate until that Position event occurs? Is there any way to force that Position event to occur or to know programmatically if it has occurred?

    #2
    imported post

    That is correct, their is an internal position event that is thrown which in turn triggers the update in the log and the buffer that holds the position data for the ATI. The position event for IB is triggered by TWS itself. Therefore, if their is a 24 second lag its because TWS has not sent the update for 24 seconds. This is a limitation on their side. You could check the order status of the order to see if the position event will ultimately fire.
    RayNinjaTrader Customer Service

    Comment


      #3
      imported post

      Is is the case if you are connected to Sim101 only that the NTMarketPosition always remains 0? I cannot seem to get any value other than 0 from it at any time. What I want toknow is if I close a position that it has been successfully executed.

      Comment


        #4
        imported post

        Should not be the case. If you can reproduce each time, please provida a small test script that we can test against.
        RayNinjaTrader Customer Service

        Comment


          #5
          imported post

          What I've done is change your "NT Sample.efs", changing the NTCommand to use "FDAX 09-06" as the instrument of choice rather than the getSymbol(). I've also had quite a hassle in running it at first but managed to get the latest software and still have an issue with it. Running v5.2.1000.2

          The amended version is available in the post.
          Attached Files

          Comment


            #6
            imported post

            If you use the original script, does it work as you expect?
            RayNinjaTrader Customer Service

            Comment


              #7
              imported post

              The only thing I've changed is to replace the getSymbol function based on the previous issueof NT5 having problemsresolving eSignal DAX codes (AX U6-DT to FDAX 09-06). What I am looking for is the capability of knowing how many contracts I have in the market right now so that I can plan further moves. I am considering strategies but will want to run multiple strategies at the same time.

              My expectation is that hard-coding the symbol should not stop the function from working and in other scripts I've run NTMarketPosition with blank parameters and also explicit parameters for symbol and account.

              Comment


                #8
                imported post

                I've now fixed my MarketPosition issue. It amounted to PEBKAC when adjusting the NT functions to work with FDAX.

                Thanks for your patience...

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by rdtdale, Today, 01:02 PM
                0 responses
                1 view
                0 likes
                Last Post rdtdale
                by rdtdale
                 
                Started by alifarahani, Today, 09:40 AM
                3 responses
                15 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by RookieTrader, Today, 09:37 AM
                4 responses
                18 views
                0 likes
                Last Post RookieTrader  
                Started by PaulMohn, Today, 12:36 PM
                0 responses
                5 views
                0 likes
                Last Post PaulMohn  
                Started by love2code2trade, 04-17-2024, 01:45 PM
                4 responses
                40 views
                0 likes
                Last Post love2code2trade  
                Working...
                X