Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting with EOD data and EnterLongStop()

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

    Backtesting with EOD data and EnterLongStop()

    I am trying to enter a position with a EnterLongStop() order during backtesting using EOD data and the orders never get executed and I am not sure why. If I submit the order and the next bar goes through my stop position, why wouldn't the order be placed. I've tried the various options for EnterLongStop() including using this one:

    EnterLongStop(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double stopPrice,string signalName)

    with liveUntilCancelled = true, but still no entries. I am using
    CalculateOnBarClose =
    true; - if that makes a difference.

    The log says something like this:

    "... order has been ignored since the stop price is less than or equal to the close price of the current bar."

    Why won't the order stay open since liveUntilCancelled = true?

    #2
    Mike, it sounds like you submit the stop order at an invalid price - please print your stop order price and the last Close (bid / ask in realtime) to make sure a valid stop price is used as the order is created in your script.

    Comment


      #3
      Perhaps I misunderstand the EnterLongStop() API. If I'm doing EOD backtesting, and I want to place an order to go long on a stock if the price exceeds the close of the current bar, how would I do that?

      Comment


        #4
        Mike, you just need to make sure you submit the order at an appropriate price-it wouldn't make sense to place a buy stop order below the current market price because it would be triggered immediately. Try entering a higher price for the order.
        AustinNinjaTrader Customer Service

        Comment


          #5
          Ah, yes, that did it, thanks!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          50 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X