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

Order Fill Resolution Trading Hours/ Session

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

    Order Fill Resolution Trading Hours/ Session

    How do I set the Order Fill Resolution to use a different set of trading hours from main DataSeries?

    The reason I ask, is that this would be a great solution for getting end-of-day executions without having to add a second data series.

    For example:
    If I set the primary dataseries to the ES ##-## daily bars (405 min) using the RTH Session and then backtest using high order fill resolution of 1 minute but using the ETH session I would get the approximate fill of the close without having to add the complexity of adding an additional dataseries.

    #2
    Hello GrumpyTrader,

    Thanks for writing in.

    The Strategy Analyzer does not have an ability to set a Trading Hours template for High Order Fill Resolution. It will use the Trading Hours template of the primary data series of the chart.

    Since you can specify a Trading Hours template within AddDataSeries(), you will be best implementing this with a second data series as you have mentioned.

    If you would like me to submit a feature request on your behalf to track your interest in this ability, please let me know.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim,
      Thanks for writing back. The problem with adding a second data series by specifying a different trading hours template is that you can't make the symbol dynamic. The reason for that is the Instrument (where I would grab the symbol being used) isn't available until the DataLoaded State (when running optimizations).

      It is pretty useless to have a strategy that needs the code to be modified by just changing the symbol it is being run against.

      Any suggestions?

      Comment


        #4
        Hello GrumpyTrader,

        Thanks for the reply.

        Yes, it looks like the there is not a way we can work around this for optimization backtests. Typically you could just add an instrument in the following way:

        Code:
        AddDataSeries(Instrument.FullName, new BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 1440 }, "Default 24 x 7");
        However, since this is added in State.Configure you would then get errors for OnStateChange() when running optimization backtests.

        I will submit a feature request on your behalf and will update this post on the status of the feature request.

        Thanks in advance for your patience.
        JimNinjaTrader Customer Service

        Comment


          #5
          Thanks Jim,
          I really hope some solution gets implemented as there is no easy way to run / model daily strategies in ninjatrader as it stands. I've tried every work around. The only solution I could come up with is to backtest strategies using a lower time frame (1 minute ETH) and create synthetic daily bars for the RTH session. The problem with this solution is that you have to re-write every indicator to use the synthetic bars as I couldn't figure out how to create a synthetic Bars object to initialize the Series object. Any ideas on this approach?

          Comment


            #6
            Hello GrumpyTrader,

            Thanks for the reply.

            It would be possible to create a custom bar type that holds data for RTH trading hours. You would still have to update every indicator call to reference this, but you could also add code to use those indicators with a different bar type conditionally if you are using the "Backtest" account.

            You may wish to use a performance metric to accomplish your needs instead of creating a work around with a custom Bars Type.

            Here is a performance metric sample that should be able to get you started:


            Additionally, your feature request is being tracked with the ticket ID SFT-1173. When it is implemented, you can reference this ticket number in the Release Notes of the version of NinjaTrader 8 that includes this feature.

            Release Notes can be found here: https://ninjatrader.com/support/help...ease_notes.htm

            Please let me know if I may be of further help.
            JimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rtwave, 04-12-2024, 09:30 AM
            2 responses
            20 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by tsantospinto, 04-12-2024, 07:04 PM
            5 responses
            68 views
            0 likes
            Last Post tsantospinto  
            Started by cre8able, Today, 03:20 PM
            0 responses
            7 views
            0 likes
            Last Post cre8able  
            Started by Fran888, 02-16-2024, 10:48 AM
            3 responses
            49 views
            0 likes
            Last Post Sam2515
            by Sam2515
             
            Started by martin70, 03-24-2023, 04:58 AM
            15 responses
            115 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X