Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLongLimit not working as expected?

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

    EnterLongLimit not working as expected?

    I have been SIM a strategym, and need to clarify why I am seeing this (to me) unexpected behaviour.

    MBTrading, no other data source,NT7R1, COBC=true, Orders are entered as limit (closes[0][0]+ticks) and true to keep the order active. Different account names are used for each strategy.
    if ((iOrderL1 == null || Historical) && iQuantity1 != 0)
    iOrderL1 = EnterLongLimit(0, true, iQuantity1, (Closes[0][0]+(3*TickSize)), sENTRY1L); // CLOSES order for PT1
    Print("ClosesLONG. PT1 "+(Closes[0][0]+(3*TickSize))+" Limit order goLONG on CLOSES+3 of BIP0"+CurrentBars[0]+" time="+Times[0][0]+" LO="+Lows[0][0]+" HI="+Highs[0][0]);
    //
    if ((iOrderL2 == null || Historical) && iQuantity2 != 0)
    iOrderL2 = EnterLongLimit(0, true, iQuantity2, (Closes[0][0]+(2*TickSize)), sENTRY2L);
    Print("ClosesLONG. PT2"+(Closes[0][0]+(2*TickSize))+" Limit order goLONG on CLOSES+2 of BIP0="+CurrentBars[0]+" time="+Times[0][0]+" LO="+Lows[0][0]+" HI="+Highs[0][0]);
    //
    if ((iOrderL5 == null || Historical) && iQuantity5 != 0)
    iOrderL5 = EnterLongLimit(0, true, iQuantity5, (Closes[0][0]+(1*TickSize)), sENTRY5L);
    Print("ClosesLONG. PT3"+(Closes[0][0]+(1*TickSize))+" Limit order goLONG on CLOSES+1 of BIP0="+CurrentBars[0]+" time="+Times[0][0]+" LO="+Lows[0][0]+" HI="+Highs[0][0]);
    //
    Price actually moves below the close 20+ times on a 3 second bar during the time of building of the entry bar, but no trade is entered on the closes version of the strategy. On the same exact strategy (except highs[0][0] are used to enter)
    if ((iOrderL1 == null || Historical) && iQuantity1 != 0)
    iOrderL1 = EnterLongLimit(0, true, iQuantity1, (Highs[0][0]+(3*TickSize)), sENTRY1L); // Highs order for PT1
    Print("HighsLONG. PT1 "+(Highs[0][0]+(3*TickSize))+" Limit order goLONG on Highs+3 of BIP0"+CurrentBars[0]+" time="+Times[0][0]+" LO="+Lows[0][0]+" HI="+Highs[0][0]);
    //
    if ((iOrderL2 == null || Historical) && iQuantity2 != 0)
    iOrderL2 = EnterLongLimit(0, true, iQuantity2, (Highs[0][0]+(2*TickSize)), sENTRY2L);
    Print("HighsLONG. PT2"+(Highs[0][0]+(2*TickSize))+" Limit order goLONG on Highs+2 of BIP0="+CurrentBars[0]+" time="+Times[0][0]+" LO="+Lows[0][0]+" HI="+Highs[0][0]);
    //
    if ((iOrderL5 == null || Historical) && iQuantity5 != 0)
    iOrderL5 = EnterLongLimit(0, true, iQuantity5, (Highs[0][0]+(1*TickSize)), sENTRY5L);
    Print("HighsLONG. PT3"+(Highs[0][0]+(1*TickSize))+" Limit order goLONG on Highs+1 of BIP0="+CurrentBars[0]+" time="+Times[0][0]+" LO="+Lows[0][0]+" HI="+Highs[0][0]);
    //
    there are trades taken during the same entry bar !!

    Is there something in my code that needs fixing, OR ??? This is my best clearest example, but definitely not isolated example. At this point I had 'fixe' everything I thought might be affecting this issue.

    Jon
    Attached Files

    #2
    HI Jon,

    Which snippet isn't working the way you expect? Can you isolate to only one order or do all orders need to be there to see it? Do you still see an issue when run against supported bar types? Try against bar types that are supplied with default NT installation only.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      HI Jon,

      Which snippet isn't working the way you expect? Can you isolate to only one order or do all orders need to be there to see it? Do you still see an issue when run against supported bar types? Try against bar types that are supplied with default NT installation only.
      Ryan,

      As per the screenshot example, the closes[0][0] trades are not being entered.

      Each order is 'isolated' in that there is a different size of tick 'buffer' allowed for entry ... the 6 tick target is allowed an entry within 3 ticks of the enterlonglimit on close/high etc .. I am not sure if that is what you mean.

      I am trying again on the NT supplied range bars. The point to me is that the closes[0][0] or highs[0][0] become an actual point value/$$ amount when submitted to the broker so bar type has nothing to do with that value, and the bar is closed when the value is calculated. !?

      Jon

      Comment


        #4
        Jon,

        Please test any issues on latest release 3 using only supported bar types. Release 3 is available here:


        If you are still seeing issues, provide the simplest snippet and steps needed to reproduce. The snippets you posted can be cleaned up by removing the variables or including variable declarations.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Sorry, dont want to install SP1 yet, and R2 had issues with genetic optimization that I need to stay away from .. I tried with range bars and all 4 of the charts took trades as expected this last time around .. ie 2 range charts, 2 better renko, of these 2 are on closes[0][0] and 2 on highs[0][0] ... IF it reproduces again and on the range bars can I send you the strategies to run in SIM

          Jon

          Comment


            #6
            Thanks, Jon. For upgrade clarification: Service pack 1 is not an installation requirement for 7.0.1000.3. If you're using service pack 1, then 7.0.1000.3 is required for your 3rd party add ons to be compatible.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Ryan,

              As the entry conditions are multiTimeFrame, and I enter on one of those frame, I am thinking I am getting a different frame bar closeing and causing that 'true' bool to activate a cancellation.

              SAMPLE: ClosesLONG. PT3 1.3661 Limit order goLONG on CLOSES+1 of BIP0=930 time=2/22/2011 2:43:51 PM LO=1.365 HI=1.366
              Cancelled custom managed order at 2/22/2011 2:46:55 PM:

              There is no 5 BetterRenko bar at 24653

              Jon

              Comment


                #8
                Thanks Jon. I'm not sure why you are seeing this. We need a reproducible scenario to follow and shed light on what's happening. Can use market replay to simulate live trading. Please let us know if you can isolate the steps and as simple a script as possible so we can see on our end.
                Ryan M.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                633 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                364 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                567 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X