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 cmtjoancolmenero, Yesterday, 03:58 PM
      11 responses
      39 views
      0 likes
      Last Post cmtjoancolmenero  
      Started by FrazMann, Today, 11:21 AM
      0 responses
      5 views
      0 likes
      Last Post FrazMann  
      Started by geddyisodin, Yesterday, 05:20 AM
      8 responses
      52 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by DayTradingDEMON, Today, 09:28 AM
      4 responses
      26 views
      0 likes
      Last Post DayTradingDEMON  
      Started by George21, Today, 10:07 AM
      1 response
      22 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Working...
      X