Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exiting Multiple Contracts

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

    Exiting Multiple Contracts

    I am trying to get a strategy to exit in multiple ways. I want to trade 3 contracts, exit two at a profit of 3 tics, and exit the third using a trailstop of 5 tics. I identify two orders Cont1=2, Cont2=1. I enter the orders when I my entry condition is satisfied and the entries are working fine. I have a stop loss of 5 tics, and the stop loss is working fine. The problem is I never get a trail stop exit. The strategy continues to hold the third contract until the end of day exit, or until a reverse entry condition occurs. Since there is no way to identify in the strategy wizard a long position after the profit exit has occured, I tried using the Position.Quantity == 1 (or -1) as the qualifier for a long or short condition after the profit target had been hit. The logic for the trailing stop is "exit the long if price gets to the close price of last bar plus my trail stop factor (-5 tics). I have the opposite condition for a short with a separate trl factor that is positive. Any idea why this shouldn't work. It seems to be logically correct, (but then they always do don't they)?
    Thanks
    Daven



    // Condition set 3
    if (Position.Quantity == 1)
    {
    ExitLongStop(Close[(int) (Close[1])] + LTrlStop * TickSize, "LTrlExit", "X2Long");
    }

    // Condition set 4
    if (Position.Quantity == -1)
    {
    ExitShortStop(Close[1] + ShtTrlStop * TickSize, "STrlExit", "X2Short");
    Last edited by daven; 04-28-2008, 04:15 PM. Reason: Typo

    #2
    Try using Position.MarketPosition instead.

    Code:
    if (Position.MarketPosition == MarketPosition.Long)
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    659 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    374 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X