Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-time frame strategy - Aessing non-PrimaryScc

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

    Multi-time frame strategy - Aessing non-PrimaryScc

    Here's one for the floor...

    A previous event flagged by setting a variable equal to CurrentBar allows the printing of the time this occurred ... Print (Time[CurrentBar - variable].ToString()); Where a multi-time frame strategy is constructed (and appropriately synchronized), the "CurrentBar" integer refers to the current "BarsInProgress" dataSeries.

    The CurrentBar of different dataSeries can be stored as variables (e.g. PrimaryCurrentBar, SecondaryCurrentBar) to allow the recall of the desired dataSeries CurrentBar even when that dataSeries is not in progress. Thus allowing the calculation of the number of bars ago of whereby some flagged event in the Secondary dataSeries occurred even when that dataSeries is not in progress.

    However, the Time.ToString syntax still refers to the Primary dataSeries. So, Print (Time[SecondaryCurrentBar - Secondaryvariable].ToString()); will return the time X barsago on the primary dataSeries.

    Any ideas on how to point the Time.ToString syntax at the secondary dataSeries to return the correct time value??

    Regards
    Shannon
    Last edited by Shansen; 10-23-2009, 07:41 PM.

    #2
    Hi Shannon, the property you're looking for is Times.

    The format for use is as follows:
    Code:
    Times[int barSeriesIndex][int barsAgo]
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin,

      Thanks a bunch... it worked a treat.
      Apologies, I should have worked that one out myself.

      Shannon

      Comment


        #4
        The Times array points to the times for the different BarsArray objects, so Print(Times[1][SecondaryCurrentBar - Secondaryvariable].ToString()) should return the time you want.

        Also, I don't know if this will work in NT6.5, but in NT7 there is an undocumented BarsArray field for CurrentBar. Instead of storing the CurrentBar of a BarsArray object in a variable, you can refer to BarsArray[1].CurrentBar to get the CurrentBar of the secondary data series.

        -Kevin

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X