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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        69 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        42 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        24 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        27 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        54 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X