Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Buy limit order is not filled

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

    #16
    Please do this:

    Email in compressed format

    - The historical data
    - Your strategy
    - An image of your backtest dialog settings to reproduce whats described in post #13

    Send to our support email address attention to Ray.
    RayNinjaTrader Customer Service

    Comment


      #17
      Thanks.

      It is working as expected. If you look at the executions tab, you will see the order was filled on 9/20/07 at 10:33 AM against the 1 minute series. What happens is when NT plots an execution it finds the first bar where the time stamp will not be exceeded. So, the execution time stamp is greater than the daily bar time stamp of 9/20/07 12:00 AM and thus it gets plotted on the next bar.

      I will put this on our list to review if it can be improved.
      RayNinjaTrader Customer Service

      Comment


        #18
        Hi Ray,

        thanks a lot for the investigation. An please consider to trace the order execution in the output log since TraceOrders is set to true (only the order placement is logged).

        Should have had a look at the executions tab too but somehow it was out of my mind.

        As next step I will reinsert the time limit for the order/position, let's see how that works.

        Thanks
        Ralph

        Comment


          #19
          Hi Ray,

          some more questions regarding this testcase:

          1) ExitOnClose has to be located in OnBarUpdate(), it's not recognized when placing it in Initialize()?

          2) Removing the ExitOnClose statement from the testcase prevents the order from execution the next day (I checked it this time with the execuions tab). Does that mean that the order is first submitted under if(BarsInProgress==0) {...} and then cancelled immediately after that (and not the next day as suggested in the output log)?

          3) What is best practice to submit the order at the end of the trading day valid just for the next trading day for this testcase? Of course I want to backtest in the 1 minute timeframe. Could I implement something like that:
          if (BarsInProgress == 0) {
          if (ExitOnClose == true) ExitOnClose == false;
          if (EntryOrder != null) CancelOrder(EntryOrder);
          EnterLongLimit(1, true, 1, Price, "Buy limit");
          }
          OnExecution() {
          Test EntryOrder and reset if appropriate;
          }

          Regards
          Ralph

          Comment


            #20
            1) Its overriddent by the parameter in the strategy dialog which is hidden from view (but still there) when daily bars is selected. That's why I suggested setting it on 1st call to OnBarUpdate().

            2) You placed the order on close of 9/19 against the 1 min series, when 1 minute series gets to 9/20/ 12 AM, it triggers end of session handling giving you the result of it being cancelled right away

            3) You could try that
            RayNinjaTrader Customer Service

            Comment


              #21
              Originally posted by NinjaTrader_Ray View Post
              1) Its overriddent by the parameter in the strategy dialog which is hidden from view (but still there) when daily bars is selected...
              What about unhide ExitOnClose for daily bars? It is still meaningful for multi-timeframe strategies like this and it would be meaningful for daily-bars-only strategies: True: Orders are valid and positions are kept open until closed by the program, False: Ordes are cancelled at the end of next daily bar and positions are closed with the daily close price.

              Regards
              Ralph

              Comment


                #22
                We are reviewing that.
                RayNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ETFVoyageur, Today, 07:05 PM
                0 responses
                7 views
                0 likes
                Last Post ETFVoyageur  
                Started by Orion815, 05-02-2024, 08:39 AM
                2 responses
                18 views
                0 likes
                Last Post Orion815  
                Started by suroot, 02-25-2017, 04:43 AM
                11 responses
                2,551 views
                0 likes
                Last Post Zilvercat  
                Started by Rogers101, 05-05-2024, 11:30 AM
                16 responses
                50 views
                0 likes
                Last Post Rogers101  
                Started by ninza33, Today, 12:31 PM
                2 responses
                12 views
                0 likes
                Last Post ninza33
                by ninza33
                 
                Working...
                X