Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Restricting Trade Direction Based on Active Strategy

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

    Restricting Trade Direction Based on Active Strategy

    Hi there,

    I'm currently trading with two strategies on my account, both of which can take long and short positions.

    Is there a way to ensure that if Strategy A is in a long position, Strategy B will only be able to take long positions (and not shorts) while Strategy A's position remains open?

    In essence, I want to make sure that when multiple strategies are running, if one is active, all other strategies are forced to trade in the same direction until the initial position is closed.

    Any guidance will be much appreciated, thanks.

    #2
    Hello RoswellTrader,

    Thank you for your post.

    NinjaScript strategies aren't aware of each other's positions. Each strategy instance has an independent position that does not have any supported methods to be read by another strategy instance. Instead of having multiple strategies, you could consider combining the strategies into one strategy.

    If you want to use unsupported methods, consider using static properties in an Add On class to share information. However please note that as this is unsupported, the support team is not able to assist you with unsupported code.

    Please let me know if you have any other questions.​

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    55 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    37 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    17 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    19 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    49 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X