Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get account position & orders

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

    Get account position & orders

    Hello fellow humans,
    I'm developing a strategy, which will be added multiple times to the same instrument using the same account.
    I'm unable to acquire the information of the Account position & Account orders/order updates. My goal is to prevent the strategy from placing entry orders if the Account is either in a Position, or has open entry orders, and if possible I would like to keep the managed approach.
    All which I could find regarding this topic didn't help. Strangely enough, while I've tried different approaches to access different information about the Account of the strategy, the information often doesn't seem to represent what it should. E.g. PositionAccount.MarketPosition is always flat, even if the strategy calling this method is not. I can confirm that the account I'm accessing is definitely an instance of the selected Account. I've been testing using the playback for context.
    So, how do I read the Account position and how do I know if the Account has open entry orders?

    #2
    Just use 'Wait Until Flat' for 'Start Behavior' for the Strategy.

    Comment


      #3
      Thank you for the reply, but my issue is not the initial situation. I want to prevent these strategies from placing orders whenever the Account is in a position or has open entry orders while they're running. I.e. if Strategy A and B are running, the Account is flat and A places an entry, B should not be able to place any entry order while that of A is open. And if the Account then enters a Position, both A and B should not submit new entry orders. The problem is if A enters a Position, e.g. Long, A is in the Position Long, while B remains flat.

      Comment


        #4
        Hello Human#102,

        You can use PositionAccount for that purpose in realtime. If a strategy enters historical trades those are not on the account so the account would be flat at that point.

        Keep in mind because strategies are executed separately you can still run into situations where both strategies may trade before the position is updated. If strategy A places a trade but strategy B's condition becomes true before the position update you will still have a case where both strategies trade. Its always best to combine multiple strategies into a single strategy so it has a complete view of the logic and position and then just run 1 instance of the strategy.

        Comment


          #5
          Thank you Jesse, that explains my issues with PositionAccount. I did end up combining the strategies into one as you described.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          52 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          70 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          43 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          47 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X