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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X