• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy AddDataSeries - Offset DataSeries

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

    Strategy AddDataSeries - Offset DataSeries

    NT Team,

    Extending from your example Multi-Time Frame & Instruments - How bars data is referenced, is it possible to "offset" added DataSeries?

    In your example, the Primary DataSeries is 1min and the Secondary DataSeries is 3min. Bars in the Secondary DataSeries end on Bars 3, 6, and 9. In the attached picture, BarsArray 2.

    Is it possible to "offset" added Data Series such that Bars end on Bars 4, 7, and 10. Or alternatively, such that Bars end on Bars 5, 8 and 11. In the attached picture, BarsArrays 3 and 4 respectively.

    Should it be possible, would any complications arise at End of Day (EOD)?

    Shannon
    Attached Files

    #2
    Hello Shansen,

    Thank you for your post.

    Offsetting the bar reference here would not be possible. Each minute based bar type will start at the same time at the beginning of the data loaded. Therefore the 3 minute will end on every 3 minutes, 5 minute on every 5 minutes and so on. There is no means to offset this.

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Patrick,

      Thank you for your reply.

      Revisiting this query, I noticed the original "explanatory" diagram was incorrect.
      To cover off, with a corrected diagram (attached),
      Is it possible to "offset" added Data Series such that Bars end on Bars 4, 7, and 10. Or alternatively, such that Bars end on Bars 5, 8 and 11. In the attached picture, BarsArrays 3 and 4 respectively.
      For example where the Primary DataSeries is 5min, and the Secondary DataSeries is 15min:
      - Primary DataSeries Bar concludes at 11:05am, 11:10am: and 11:15am, etc.
      - Secondary DataSeries Bar concludes at 11:15am covering the period (11:00am - 11:15am), etc,
      - Tertiary DataSeries (offset) Bar concludes at 11:20am covering the period (11:05am - 11:20am), etc,
      - Quaternary DataSeries (offset) Bar concludes at 11:25am covering the period (11:10am - 11:25am), etc.


      Thanks again
      Shannon
      Attached Files
      Last edited by Shansen; 10-08-2017, 05:44 PM.

      Comment


        #4
        Hello Shansen,

        Thank you for your response.

        Each bar begins at the start of the first available historical data as requested from the 'Load data based on' setting in the Data Series menu and the 'Days to load', Bars to load', or 'Custom range' setting. The Trading Hours template (Session Template in NinjaTrader 7) will dictate the start of the first bar on the first day it is available.

        What this means in a 5 minute bar will close 5 minute after the start of the session and a 15 minute bar will close 15 minute minutes after the start of the session. Therefore each preceding bar will close 5 or 15 minutes respectively after.

        With that said you could create a new Trading Hours template for the added series you wish to offset that started however many minutes you need after the primary instruments session start.

        For example I created a Trading Hours Template based on the 'CME US Index Futures ETH' but it starts 3 minutes after the original. I then added this Trading Hours template in a 5 minute bar to my strategy and added it to a 5 minute chart of the same instrument that using the default 'CME US Index Futures ETH' template.

        Attached is a screenshot of the Trading Hours Template I edited and below you will find the code I used to test.
        Code:
        			else if (State == State.Configure)
        			{
        				AddDataSeries("ES 12-17", new BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 5 }, "TestOffset");
        			}
        		}
        
        		protected override void OnBarUpdate()
        		{
        			Print("");
        			Print(BarsInProgress);
        			Print(Times[0][0]);
        			Print(Times[1][0]);
        		}
        Please let me know if you have any questions.
        Attached Files
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by akuntysh, Today, 04:56 AM
        0 responses
        1 view
        0 likes
        Last Post akuntysh  
        Started by YevhenShynkarenko, Today, 02:55 AM
        0 responses
        39 views
        0 likes
        Last Post YevhenShynkarenko  
        Started by pjsmith, Today, 02:20 AM
        0 responses
        11 views
        0 likes
        Last Post pjsmith
        by pjsmith
         
        Started by faisamtrader, Yesterday, 10:03 PM
        0 responses
        8 views
        0 likes
        Last Post faisamtrader  
        Started by johnnybegoode, Yesterday, 08:11 PM
        0 responses
        4 views
        0 likes
        Last Post johnnybegoode  
        Working...
        X