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.
    BertrandNinjaTrader Customer Service

    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 pvincent, 06-23-2022, 12:53 PM
          14 responses
          238 views
          0 likes
          Last Post Nyman
          by Nyman
           
          Started by TraderG23, 12-08-2023, 07:56 AM
          9 responses
          383 views
          1 like
          Last Post Gavini
          by Gavini
           
          Started by oviejo, Today, 12:28 AM
          0 responses
          1 view
          0 likes
          Last Post oviejo
          by oviejo
           
          Started by pechtri, 06-22-2023, 02:31 AM
          10 responses
          125 views
          0 likes
          Last Post Leeroy_Jenkins  
          Started by judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Working...
          X