Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exits before Entry

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

    Exits before Entry

    I'm using an ES Continuation with 20 min as the primary series and 10 and 1 as the 2nd and 3rd series, respectively. Why is this exiting before entry in November of 2008? Also doing it in 2011. I have a negative avg time in market for my short trades. How can this be?

    // ENTRY CONDITIONS
    if (BarsInProgress==0) {
    if (

    ( Position.MarketPosition == MarketPosition.Flat &&

    (
    (Closes[0][0]-Opens[0][0] >= (10*TickSize)) && (Closes[0][0]-Opens[0][0] <= (40*TickSize))
    )

    || (
    (Closes[1][0]-Opens[1][0] >= (7*TickSize) && Closes[1][0]-Opens[1][0] <= (40*TickSize))
    )

    && (BarsSinceExit(3,"Long",0) == -1 || BarsSinceExit(3,"Long",0) > 0)

    )
    //2. The volume on the bar is greater than 50k contracts
    && (VOL()[0] > 50000)



    )
    {
    EnterLong(3, 1,"Long");
    EnterLong(3, 1,"LockedLong");

    }
    }

    //PROFIT EXIT

    //Position will exit on the following conditions
    if (BarsInProgress==0) {
    if (
    // #1. The high of a 20 minute bar is less than 4 ticks below the last
    (Highs[0][0] < Highs[0][1] - (4*TickSize))
    // #2. The high of a 10 minute bar is less than 8 ticks below the last
    || (Highs[1][0] < Highs[1][1] - (8*TickSize))
    // #3. The high of a 5 minute bar is less than 8 ticks below the last
    || (Highs[2][0] <= Highs[2][1] - (8*TickSize))

    )
    {
    ExitLong(3, 1, "ExitLockedLong", "Long");
    ExitLong(3, 1, "ExitLong", "LockedLong");
    }
    }
    Last edited by albazzaztariq; 01-30-2014, 07:48 PM.

    #2
    albazzaztariq, just looking at the code - are you sure you're not adding in a 4th series as well? As per your code posted you're submitting to a BIP == 3, which would be the 4th series then.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      albazzaztariq, just looking at the code - are you sure you're not adding in a 4th series as well? As per your code posted you're submitting to a BIP == 3, which would be the 4th series then.
      I'm sorry, I put 10, 5, and 1 min as the different series. 20 is primary.

      Comment


        #4
        Thanks - was giving it a run and unable to reproduce here. I don't see any negative trades times either for either longs or shorts. Can you please try rerunning the test on a fresh set of data / cache and see if the issue would persist to show?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        650 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 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
        577 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X