Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Managing EnterLongStop in backtest - gapping issue

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

    Managing EnterLongStop in backtest - gapping issue

    Hi there,

    I have developed a strategy that works well most of the time. This is for backtesting only, using daily charts, but I also have a 1-minute granular series added to fine-tune my entries and exits. I use:

    FirstEntry = EnterLongStop(0, true, DefaultQuantity, higherHighPrice, "FirstEntry");

    to make my entries at the end of the day - so the order is created and waiting for the next day to be execution. It works fine most of the time, but occasionally the market gaps up especially on daily charts, above my stop price - and the order gets ignored. So, my question is - how would I handle that? I still want to get in on market open at any price above my stop - whether the market gaps up or not.

    Any help is appreciated.

    Thank you!

    -roberto

    #2
    Originally posted by roberto76 View Post
    Hi there,

    I have developed a strategy that works well most of the time. This is for backtesting only, using daily charts, but I also have a 1-minute granular series added to fine-tune my entries and exits. I use:

    FirstEntry = EnterLongStop(0, true, DefaultQuantity, higherHighPrice, "FirstEntry");

    to make my entries at the end of the day - so the order is created and waiting for the next day to be execution. It works fine most of the time, but occasionally the market gaps up especially on daily charts, above my stop price - and the order gets ignored. So, my question is - how would I handle that? I still want to get in on market open at any price above my stop - whether the market gaps up or not.

    Any help is appreciated.

    Thank you!

    -roberto
    Then use a Market Order. (Generally not a good idea to use Market Orders for entry, IMHO. That is just asking to get fleeced).
    Code:
    EnterLong(...);

    Comment


      #3
      Thanks for that, I am not worried about getting fleeced as this is just a backtest . But, the market order won't work for me - the reason why I'm using a stop order is that I want to be in only if price is over a certain level - hence my stop order. I don't want to be long if price is under the stop..... Any other ideas?

      Comment


        #4
        Originally posted by roberto76 View Post
        Thanks for that, I am not worried about getting fleeced as this is just a backtest . But, the market order won't work for me - the reason why I'm using a stop order is that I want to be in only if price is over a certain level - hence my stop order. I don't want to be long if price is under the stop..... Any other ideas?
        Then you will have to test for the gap, and make your entry at the price that you want. Opens[1] against Closes[0].

        Comment


          #5
          Hi Roberto,

          Thank you for your post and thank you Koganam for replying.

          Koganam is correct that you will need to test for when the gap and then place your Stop Order at the entry price you want.

          Let us know if we can be of further assistance.
          Cal H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X