Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Transmittion of data from DataSeries with different time frames

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

    Transmittion of data from DataSeries with different time frames

    Dear all,

    I am facing an issue with moving a value computed (and stored in a dataseries) at a lower time frequency (TF2) to a dataseries of a higher time frequency (TF1).
    The code is as per below.

    1. Define the dataseries with different data timeframes:

    if (myAbsOpenCloseSeries == null)
    {
    myAbsOpenCloseSeries =
    new DataSeries(SMA(BarsArray[1],5));
    myAbsMedianSeries =
    new DataSeries(SMA(BarsArray[1],5));
    }

    myUpBreakoutSeries = new DataSeries(this);

    2. On the lower timeframe, run a statistic computation (working correctly)


    3. Calling the statistic to the higher time frame dataseries when they are in sync else copying/paste the previous data (where my issue is)

    if (BarsInProgress == 0)
    {
    // NOT WORKING: EMTPY DATA IN THE TWO DATASERIES //
    myUpBreakoutSeries.Set(myUpBreakoutSeries[1]);

    if (Times[0][0].Ticks == Times[1][0].Ticks)
    // WORKING //
    {
    maUpOpenBreak = Opens[
    0][0] + myAbsMedianSeries[1];
    myUpBreakoutSeries.Set(maUpOpenBreak);

    }

    Thank you very much,
    Best

    Nicolas

    #2
    Hi Nicolas, when you add in debug prints to your script, do you really see a zero value for the custom series synched to the primary series or would it be the 'dummy' Close value, which is used if no value has been specifically .Set for this bar?

    Comment


      #3
      Hello Bertrand,

      Yes it does. I attach a txt version of the code.
      Thanks for looking at my issue. Appreciated.
      Best

      Nicolas
      Attached Files

      Comment


        #4
        Hello Nicolas,
        To assist you further may I know what is the primary data series you are testing the indicator.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Hi Joydeep,

          If I understood correctly your question, I have tested the script with USDEUR, 1h. My secondary time-frame is 3h.
          Thanks a lot,
          Best

          Nicolas

          Comment


            #6
            Hello Nicolas,
            Thanks for the information.

            The secondary series in your code refers to a daily bar series
            Code:
            Add(PeriodType.Day, TF2);
            To clarify further is it the same code or I need to change the timeframe.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              JoyDeep,
              It is the same code, and indeed variables are confusing.
              "Add(PeriodType.Day, TF2);" with TF2 refers to "private int TF2 = 3;"
              Hope I am understanding correctly your question.
              Thanks,
              Best

              Nicolas

              Comment


                #8
                Hello nlaporte,
                If you are trying to add a 3 hours bar series then the code will be:
                Code:
                private int TF2	= [COLOR="blue"][B]180[/B][/COLOR];
                Add(PeriodType.[COLOR="Blue"][B]Minute[/B][/COLOR], TF2);
                In your code you have referenced to a daily bar series.
                Code:
                [COLOR="Red"]Add(PeriodType.Day, TF2);[/COLOR]
                JoydeepNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                633 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                364 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
                567 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X