Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get account submitted or opened positions

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

    Get account submitted or opened positions

    Hello,

    I have program a strategy that use a function to adjust position size according to margin by contract requirement of the instrument.

    i got 3 strategies running on 3 different instruments
    I would like to adjust position size if there is submitted orders or opened positions in one or two of the others intruments.
    So I would calculate the margin used and remaining to re adjust position size.


    Can I do something like this :

    If the strategy trade the USOIL and there is an order or position on the US3O

    // Check for other orders or opened positions by other Algos
    if (PositionAccount.MarketPosition != MarketPosition.Flat || if there is submitted orders in instruments differents than USOIL ){
    if (PositionAccount.Instrument.MasterInstrument.Name == "@US30") {
    // I will calculate used margin here to retract it from avalaible capital

    }
    // And will do the same for the third instrument

    }



    Thanks for the help

    #2
    Hi algoroman, thanks for posting.

    The best thing to do would be to add the other instruments with AddDataSeries() and manage everything from one strategy. If that is not possible, you will need to set up an Addon style Account object and subscribe to its ExecutionUpatate/PositionUpdate events to get an event when any order happens on the account:



    Kind regards,
    -ChrisL

    Comment


      #3
      Thanks a lot for your help.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      65 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      139 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