Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Converting Minute Data to 30 min frequency for indicator

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

    Converting Minute Data to 30 min frequency for indicator

    Hi, I'm subscribed to minute data which I use for my algo.

    However for one of the indicators, (the MACD) I'd like it so use data in 30 minute frequencies, not minutely.

    How would I do this?

    #2
    Hello mwait,

    Thank you for your note.

    You do not need to convert data. Each bar type and value is built automatically from one of the base data types such as Tick, Minute, and Day.

    In code if you need to use a specific bar type and value you would first need to add it in the Initialize() method. For example:
    Code:
    Add(PeriodType.Minute, 30);
    Then you call the bars array in your indicator. For example:
    Code:
    MACD(BarsArray[1], 12, 26, 9)[0]
    For information on multiple bar series in your code please visit the following link: http://ninjatrader.com/support/helpG...nstruments.htm

    Please let me know if you have any questions.

    Comment


      #3
      Easy enough, but seems overly complicated for several timeframes, in that you'd need to keep track of all your BarsArray[] indexes and which is which timeframe.

      Is there a way to use C# pointers so as to eliminate keeping track of which BarsArray index is needed? Can you assign a array variable name to the Add() function?

      Comment


        #4
        Hello borland,

        Thank you for your response.

        You would need to refer to the different bars arrays by their index (0, 1, 2, etc.). there would not be a means around this in NinjaScript, and I am not aware of any work around in C# that would suffice for what you mention.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        18 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        120 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        174 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        92 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        134 views
        0 likes
        Last Post cmoran13  
        Working...
        X