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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      72 views
      0 likes
      Last Post PaulMohn  
      Working...
      X