Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access strategy B from strategy A

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

    Access strategy B from strategy A

    Hi,

    Can strategies access the positions of each other?

    for example if i'm long APPL in strategy A, i don't want to go long APPL in strategy B?

    Ideally i want to be trading many markets and many strategies.

    should i have one NT strategy that trades all markets, or many NT strategies?
    I need the strategies to be aware of what positions the other strategies are in.

    Cheers

    #2
    Hello pipsalottle,

    Thank you for your post.

    Strategies would not have a method or function to access other strategies positions.

    You can use unsupported means to pull the account positions though. For example:
    Code:
    foreach (Account acct in Cbi.Globals.Accounts)
    {
    if (acct.Positions != null)
    {
    PositionCollection positions = acct.Positions;
    foreach (Position pos in positions)
    {
    Print(pos.Account.Name + " " + pos.Instrument + " " + pos.MarketPosition + " " + pos.Quantity + " " + pos.AvgPrice);
    }
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by f.saeidi, Today, 12:14 PM
    8 responses
    17 views
    0 likes
    Last Post f.saeidi  
    Started by Mikey_, 03-23-2024, 05:59 PM
    3 responses
    49 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Started by Russ Moreland, Today, 12:54 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by philmg, Today, 12:55 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by TradeForge, 04-19-2024, 02:09 AM
    2 responses
    32 views
    0 likes
    Last Post TradeForge  
    Working...
    X