Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Loading indicator with different series

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

    Loading indicator with different series

    Hi guys

    I wanted to ask if there is a way to load an indicator value from another indicator but actually divert the primary series so that it loads for a different time frame. So for example my current indicator is applied to a 3 minute chart, within that indicator it loads another one and extracts a value with the following

    protected override void OnStartUp()
    {
    USS = VolatilitySwing(Input, dtbStrength, endOffset, multiplier, period).UpSwingSignals;
    DSS = VolatilitySwing(Input, dtbStrength, endOffset, multiplier, period).DnSwingSignals;
    DW = DailyWindow(Input, 3).Signal;
    }

    Are there other values that I can pass to Input instead of the default, what I gather is that Input will pass through the same data series being used as the primary in the passing indicator which in this case is the 3minute, I would however like the DailyWindow indicator to be run off the daily series. How best do I accomplish this?

    At the moment the only way I can figure it but it seems inefficient since I'm loading an extra series is to put this code into daily window indicator:

    In initialize

    Add(PeriodType.Day,1);

    In Onbarupdate

    if (BarsInProgress == 0) return;

    I think this should have the effect of overriding the primary passed series but it means this indicator can only ever run as daily for one and secondly it will be loading a second series and then ignoring one which seems inefficient.

    I'm thinking there must be a better way that I'm not aware of?

    cheers for any help
    Ross

    #2
    Think I might of figured it, this is just a thought, loading a secondary series in the calling indicator and then passing the secondary series when calling the other indicator using the secondary timeframe like below?

    protected override void Initialize()
    {
    CalculateOnBarClose = true;
    Overlay = true;
    PriceTypeSupported = true;

    Add(PeriodType.Day, 1);
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)

    /// </summary>
    protected override void OnStartUp()
    {
    DW = DailyWindow(BarsArray[1], 3).Signal;
    }

    Will above work?

    My other question is how many bars lookback are loaded in the the Day series that I've added since it's not configurable in the Add(), will it default to whatever the primary series is?

    Cheers
    Ross

    Comment


      #3
      Hi Ross, correct that should do it, just point to the BarsArray you want to calculate on since each indicator would implement the IDataSeries interface...the loaded days will mirror the setting you choose for the primary series / chart this is working on. Just keep in mind if you do it from within a strategy that there need to be enough bars present for all series called to satisfy the MinBarsRequired setting.

      Comment


        #4
        Thanks Bertrand, much appreciated.

        Comment


          #5
          Hi Bertrand,

          Above works a charm, one more related question I wanted to ask, is there anyway to load an indicator like I have done in the example and designate a different session template as opposed the the template designated in the calling chart or MA panel?

          Thanks again
          Ross

          Comment


            #6
            Hi Ross, great to hear - no unfortunately not, the session template will be the one your primary series uses.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sjsj2732, 03-23-2026, 04:31 AM
            0 responses
            42 views
            0 likes
            Last Post sjsj2732  
            Started by NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            294 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            290 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            135 views
            1 like
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            98 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Working...
            X