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 FrancisMorro, Today, 03:24 AM
          0 responses
          1 view
          0 likes
          Last Post FrancisMorro  
          Started by Segwin, 05-07-2018, 02:15 PM
          10 responses
          1,770 views
          0 likes
          Last Post Leafcutter  
          Started by Rapine Heihei, 04-23-2024, 07:51 PM
          2 responses
          31 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by Shansen, 08-30-2019, 10:18 PM
          24 responses
          944 views
          0 likes
          Last Post spwizard  
          Started by Max238, Today, 01:28 AM
          0 responses
          11 views
          0 likes
          Last Post Max238
          by Max238
           
          Working...
          X