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

Fill trades on currect close in backtesting

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

    #16
    Originally posted by NinjaTrader_RyanM View Post
    An exit order isn't submitted until the entry order fills. You should not have exit and entry orders working at the same time for the same signal name.
    OK, that's what I expected. I call EnterLongLimit(), ExitLongLimit(), and ExitLongStop() all at the same time. I guess I should have asked, if the exit orders are all associated with the entry, are they linked as OCO, so if one gets filled the other is automatically cancelled?

    Just trying to figure out how much I need to manage myself.
    -A

    Comment


      #17
      GM Alex, no unlike the Set()'s the Exit()'s would not OCO linked per default, you would need to do the cancelling as needed and thus provide the OCO functionality via your code. Only the unmanaged mode would offer a SubmitOrder() method that would enabled you to directly link orders via custom string together so they are OCO'ed directly.
      Last edited by NinjaTrader_Bertrand; 04-03-2012, 02:43 AM.
      BertrandNinjaTrader Customer Service

      Comment


        #18
        Originally posted by pretender View Post
        My personal solution was to create a new fill type.
        Just copy any of the other fill types into a new file, then I rewrote the limit order type fill to:

        FillPrice = order.LimitPrice;

        erasing everything else. This fill type will essentially fill the order at whatever limit price you set (which you can then set to the corresponding close), although the entry date will still be counted as next day.
        Dear pretender, would you be so kind to explain in detail how to do this?
        And will it solve my problem?
        I'm working with KineTick EndOfDay data. I need stop order to be filled at the day it was put, because some days are volatile and can trigger order at the day when order was placed.

        Comment


          #19
          Question to Support and Development

          Hello. Would you be so kind to explain why it is so hard to implement in NT Backtesting to trigger order by settled price? It can be because every bar has HIGH and LOW. So, if settled price between - placed order trigger by it.
          Sorry. I am newbie )))

          Comment


            #20
            alexstox, the custom fill type presented target limit order executions, which would not be of help for your stop order issue - what exact problem do you currently see? Orders placed in backtesting would be filled on the next bar in NT, as this would be the earliest possible trade location / execution point after the bar has closed, which is a conservative approach in backtesting we feel is warranted.
            BertrandNinjaTrader Customer Service

            Comment


              #21
              Originally posted by alexstox View Post
              Would you be so kind to explain why it is so hard to implement in NT Backtesting to trigger order by settled price?
              Stop or limit orders would work for that purpose. If you're describing a "market if touched" order, that's also easy to do in backtesting, but very hard in real time. I've wanted market-if-touched capability in the SuperDOM window for a long time.

              -Alex

              Comment


                #22
                Well. It's not so comfortable when testing DAILY bars.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by rocketman7, Today, 02:12 AM
                6 responses
                27 views
                0 likes
                Last Post rocketman7  
                Started by guillembm, Yesterday, 11:25 AM
                3 responses
                16 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by junkone, 04-21-2024, 07:17 AM
                10 responses
                148 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by tsantospinto, 04-12-2024, 07:04 PM
                6 responses
                101 views
                0 likes
                Last Post tsantospinto  
                Started by trilliantrader, 04-18-2024, 08:16 AM
                7 responses
                28 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X