• 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

access custom dataseries

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

    access custom dataseries

    i have a multitimeframe indicator.
    i created a custom dataseries
    how can i access barsarray created in different timeframe in lower timeframe?
    in the below example, i have a bars array ConseqLow = new Series<int>(BarsArray[1], createed in 25 min timeframe
    i would like to access the data in my basetimeframe which is 5 minutes.
    Code:
    public class PullbackBounce : Indicator
        {
     private Series<int> LongDirection, ShortDirection,ConseqLow,ConSeqHigh; // Define 
    
    protected override void OnStateChange()
            {
     if (State == State.Configure)
                    {
                        Print(BarsPeriod.ToString());
    
                        //                    if (BarsPeriod.BarsPeriodType == BarsPeriodType.Minute)
                        //                    {
                        AddDataSeries(BarsPeriodType.Minute, 25);
                        AddDataSeries(BarsPeriodType.Tick, 1);
                        
    }
    if (State == State.DataLoaded)
                    {
                        LongDirection = new Series<int>(this, MaximumBarsLookBack.Infinite);
                        ShortDirection = new Series<int>(this, MaximumBarsLookBack.Infinite)
                        ConseqLow = new Series<int>(BarsArray[1], MaximumBarsLookBack.Infinite);
                        ConseqHigh = new Series<int>(BarsArray[1], MaximumBarsLookBack.Infinite);
    
                    }
    }
    
      protected override void OnBarUpdate()
            {
     if (BarsInProgress == 0) // this is the different timeframe. how can i acces teh ConseqLow bars array?
    }
    }
    
    }

    #2
    Hello junkone,

    In OnBarUpdate, when BarsInProgress is 1, then the 25 minute series is the series processing.

    However, I am not showing there is a 5 minute series added to the script.

    If the primary series is the 5 minute series, then you would want to call the custom series when BarsInProgress is 0.

    I may not be understanding your inquiry correctly.
    Please let me know if you are not asking about which added series is the processing series.

    You can access any series at any time as long as it has bars.

    For example:
    if (BarsInProgress == 0 && CurrentBars[1] > 0)
    {
    Print(ConseqLow[0]);
    }
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by donwtrading, Today, 06:23 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by Johnny Santiago, Today, 04:51 PM
    2 responses
    10 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by nekroart, Today, 04:52 PM
    0 responses
    5 views
    0 likes
    Last Post nekroart  
    Started by otislauwaert, Today, 02:43 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_JoshG  
    Started by Johnny, Today, 02:32 PM
    3 responses
    13 views
    0 likes
    Last Post Johnny
    by Johnny
     
    Working...
    X