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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    167 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    88 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    128 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    208 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    185 views
    0 likes
    Last Post CarlTrading  
    Working...
    X