Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Preventing Two Strategies From Taking The Same Position

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

    Preventing Two Strategies From Taking The Same Position

    I have two strategies trading the same instrument (CL), both from the long side. Because of the nature of the strategies, they rarely take positions at the same time. However, for risk reduction purposes I would like to insure that that if one has gone long, the other never enters a position. Is there a test I can perform that will tell me if the other strategy is already long?

    I realize I could fold both strategies into one and then just check

    Position.MarketPosition = MarketPosition.Flat

    but given how they work I'd much rather keep them separate.

    #2
    Welcome to our forums here - unfortunately strategies would not communicate with eachother so a check for the market position from outside the invidual strategy is not possible...one workaround would be writing the current position to a textfile and then accessing this for your checks. Working with txt files is laid out in our reference samples section - http://www.ninjatrader.com/support/f...ead.php?t=3477

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    65 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Working...
    X