Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi timeframe indicator DataSeries forgets values

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

    Multi timeframe indicator DataSeries forgets values

    Hi,
    I have a multi timeframe indicator, the Bars are 5m, 30m, 60m.
    Most of the calculation is done on the 5m.
    I have a custom DataSeries synced to the 5m (BarsArray[0]).

    If I set a value into the DataSeries (for a signal for example) in BarsInProgress==0, it is remembered just fine UNLESS this bar's timestamp coincides with a bar in another timeframe. So on the half hour and on the hour, the DataSeries forgets its value.
    I programmed a variable to remember the value and set it again from the higher timeframes, (which are executed after BarsArray[0]) however DataSeries.Set(value) doesn't seem to work from a timeframe other than the one the DataSeries is synced to.

    So I currently have no workaround for this problem.

    Suggestions please?
    Thanks,
    saltminer

    #2
    Hi saltminer, what do you mean by 'forget' it's value - what value are you getting printed for this 'conflict' bar then?

    Would you have a sample of code I could check into here?

    Comment


      #3
      HI Bertrand,
      I have emailed you some code.
      The value is 'forgotten' by being set to the bar's Close price, which is what happens for a DataSeries if Set() is not used during an OnBarsUpdate().
      Cheers,
      saltminer

      Comment


        #4
        Ok got it Saltminer, will take a look shortly.

        Comment


          #5
          Replied via email directly saltminer.

          Comment


            #6
            Hi Bertrand,
            thank you for taking the time to run my code. Yes, the signal remains only for a single bar. However, the signal at ten minutes past the hour is not a test of the problem.
            If the signal occurs at a time when there is also a bar on another timeframe, for instance at the hour or the half-hour, then the value in the signals dataseries does not remain. it gets changed to the Closing price of the bar.

            I have gotten around it by creating a public double value, which will remember a value I set to it, but the overall principle of multi-timeframe indicators is going to be very difficult to use if a simultaneous OnBarsUpdate from another timeframe is going to obliterate any data generated in the principle timeframe.

            Cheers,
            saltminer


            Here's what I get running your code on 5 min ES Replay for yesterday -

            1/25/2011 7:10:00 PM found setup bar but it ADX is beneath required
            level of 25
            1/25/2011 7:10:00 PM indicator: BIP 0 signals[0] = 1
            1/25/2011 7:15:00 PM indicator: BIP 0 signals[0] = 0

            This looks like the signal is really only set for the signal bar.

            Comment


              #7
              You're welcome, thanks for taking the time to clarify saltminer, I'll give this another look to see what happens on the halfHour / Hour updates.

              Comment


                #8
                Saltminer, I took another look here but was unable to reproduce - the signal set in my BIP0 was persisted on the BIP1 call with the same timestamp, this was the case for both a custom series on BIP0 and a custom series synched to BIP1. Are you sure you set a value for every bar in the series, even if just a dummy one?

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                606 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                353 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                560 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                561 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X