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 cmoran13, 04-16-2026, 01:02 PM
    0 responses
    64 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    40 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    166 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    101 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    162 views
    2 likes
    Last Post CaptainJack  
    Working...
    X