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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          72 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          39 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          63 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          63 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          53 views
          0 likes
          Last Post CarlTrading  
          Working...
          X