Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EnterLongStop

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

    EnterLongStop

    Hello,
    Using the wizard, I am developing and testing a strategy to enter long position on upside breakouts. When the strategy identifies a break-out on the daily close, it appears that the strategy tries to enter the position at open of the next day. Of course, many breakouts fail, some badly. E.g., on Day 0, the breakout is identified, then the next day, the Strategy Analyzer enters a long position at the open when the price gaps down, an obvious failure of the breakout. To provide some protection from failure on the very date of entry, I have tried to use the EnterLongStop so that the stop would only enter if the price is at a level that makes sense. If I set the stop for EnterLongStop as Low[0], I avoid the entry date gaps down, but legitimate breakouts are not taken even though the price on the day of entry is at or above the Low of day 0, the date on which the breakout was identified.

    EnterLongStop(100, Low[0], "ChannelBreakout");

    I want the Analyzer to enter a long position at market if the price is >= the low of Day 0. Am I misinterpreting how the EnterLongStop method works?

    #2
    The reason your EnterLongStop() is not working as you expect is because of the way buy stop orders need to be placed. Buy stop orders need to be submitted at a price above the current price, but when you place them below the current price the order is rejected. Because of the nature of backtesting we cannot "peak" inside a bar and only know if an entry condition was satisfied at the close of the bar. This means all entry orders are submitted at the open of the next bar. What happens when the price gaps up above your stop price on next bar your order is invalid and rejected. This article is very useful in helping you understand the discrepancies between real-time testing and backtesting. http://www.ninjatrader-support.com/H...sBacktest.html

    If you simply want to execute an order at a specific price you may find EnterLongLimit() to fit the bill.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      EnterLongLimit

      Thanks, Josh. The link was helpful. I see what is meant about Real-Time vs. Backtesting. EnterLongLimit would still allow purchasing the gap-down failure of the breakout, which is what I am trying to avoid. In some iterations, I did try the EnterLongStopLimit, but, as I recall, it always assumed that the full limit was taken even though the open was at or above the stop and lower than the limit. I figured that was to assume that the limit was acceptable. Will play around with it some more.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      106 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      54 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      36 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      38 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      74 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X