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

Retrieve exact execution time for backtest limit orders

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

    Retrieve exact execution time for backtest limit orders

    Hi NT team,

    I have a multi-time series intraday trading strategy which I am backtesting. For example I run the strategy on daily bars, but add 60minutes bars for advanced trade logic. The 60 minute bars create enter limit orders. When I now try to retrieve the exact execution time with execution.ToString(), NT will only always give me the time of the 60 minute bar, but not the actual execution time with theoretically available minute data. I use minute data, and I have also tried adding a 1 minute bar and tried accessing the most recent time information using Times[2][0] in OnExecution(), I tried with calculate on bar close = false, etc. No success...

    Is it possible at all to have more granular information when exactly a limit order was filled in backtests?

    Thank you
    whotookmynickname

    #2
    whotookmynickname, when you say you add in 1 minute as well, do you then actually submit the orders to this BarsInProgress for the fills?

    EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)



    Sounds to me like this is the step you're missing here...
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Retrieve exact execution time for backtest limit orders

      Hi Bertrand

      I know that this is what I can do, but I would have to rewrite my code and I do not want to actually submit/manage my orders on a 1-minute level, but rather only retrieve the exact time for analysis purposes.

      Also, let's say I had tick data and I used 1-minute data for BIP/order management I would still not have the "real" trade time but just the last time of the 1-minute BIP.

      So is it fair to assume that NT cannot determine the actual fill time for backtests? Or is there a workaround other than submitting/managing the orders on a 1-minute level?

      whotookmynickname

      Comment


        #4
        Correct, there would be no other workaround - the fill resolution is determined by the series you submit to and thus could be controlled this way.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Kaledus, Today, 01:29 PM
        0 responses
        3 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by PaulMohn, Today, 12:36 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by yertle, Yesterday, 08:38 AM
        8 responses
        36 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Started by rdtdale, Today, 01:02 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by alifarahani, Today, 09:40 AM
        3 responses
        18 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X