Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PositionUpdate not returning MarketPosition = Flat

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

    PositionUpdate not returning MarketPosition = Flat

    Hello,

    I'm cloning a Trade Copier I found in the Ecosystem....

    The orders from the Master Account are copied to the Target Accounts, including the orders to close the position.

    in Position Update the MasterAccount then is reported as Flat, but the Target accounts have the original MarketPosition, (Long of Short) BUT with a zero quantity.

    I can get around this by checking the position to have a quantity of 0...but I find it rather strange that OnPosition does does not say it is Flat

    What is going on ??

    ??

    #2
    Hello llanqui,

    Not all brokers report the same position update events so depending on the brokers being used that script may or may not work if it uses position update events. Because that is a custom item that was developed for a specific use case you may need to modify it to fit your individual needs.

    Comment


      #3
      ok, I keep learning more about the internals...

      I guess in this case the broker is reporting a Position Update, but the status is not flat, although the Quantity is zero

      Comment


        #4
        once a position quantity is zero, I assume it is not any more in the Position Collection....is this true?

        so one could also iterate through the account.position collection and if there was no entry, then it would be flat.... ??

        this should work no matter what broker?

        Comment


          #5
          Hello llanqui,

          You would need to check that with the broker you are using by using a Print to see if that is the case. because each broker can supply position updates differently or even out of sequence that may or may not be true. You will need to modify the script in a way that works for your specific use case to ensure it works to your expectations.

          Comment


            #6
            ok, thanks for the warning...

            wonder what the professional trade copiers do?

            Comment


              #7
              Hello llanqui,

              The ones that I am aware of are designed around specific brokers so I would presume that the developers have designed the code to work with the connections they support. I see a couple of different trade copiers on the ecosystem app share however i don't see any details on which connection the users that uploaded them had used. They may have been using a live account with a number of brokers or also sim it would be impossible to know. Some of the more complex appshare files are very good staring points for your own projects but may need some modification to be used correctly.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              603 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              349 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              104 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              560 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              560 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X