Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator of different timeserie in graph

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

    Indicator of different timeserie in graph

    Hi all,

    First of all: My compliments on your product. I've been using it for only a few days now and am already impressed with what is possible.

    Now to my problem at hand

    I've added a 2nd timeserie to my strategy like so:

    PHP Code:
    protected override void Initialize()
    {
           Add(PeriodType.Minute, 15);
    } 
    
    I have developed a custom indicator and am able to access it in OnBarUpdate() with:

    PHP Code:
    MyCustomIndicator(BarsArray[1],123); 
    
    Now here's my question. When I'm backtesting my strategy, I would like to see the custom indicator (Using the 2nd time serie) value plotted on the backtesting chart.

    As far as I now I cannot add it in Initialize(), because BarsArray is not available there.
    I also cannot use the Add() method in OnBarUpdate() to add the indicator.

    What would be the correct way to display a custom indicator from another timeserie in the backtesting chart?

    Thanks in advance!
    Last edited by Rickman; 01-06-2015, 07:21 AM.

    #2
    Rickman, welcome to our forums and sorry for the late reply. Thanks for the kind words about our product.

    Easiest way would be adding the 15 minute series in your indicator directly and doing the multiseries calculations there and then only Add() the final indicator in your strategy Initialize().

    Another option would be using the a placeholder indicator to dynamically set the values to in the strategy OnBarUpdate() - shown in this sample > http://www.ninjatrader.com/support/f...ead.php?t=6651

    Our next major platform update will facilitate this, as strategies could then directly plot as well.

    Comment


      #3
      Hi Bertrand,

      Thank you for your answer. I was able to get it working by setting the values in the OnBarUpdate() in the indicator!

      Comment


        #4
        Originally posted by Rickman View Post
        Hi all,

        First of all: My compliments on your product. I've been using it for only a few days now and am already impressed with what is possible.

        Now to my problem at hand

        I've added a 2nd timeserie to my strategy like so:

        PHP Code:
        protected override void Initialize()
        {
               Add(PeriodType.Minute, 15);
        } 
        
        I have developed a custom indicator and am able to access it in OnBarUpdate() with:

        PHP Code:
        MyCustomIndicator(BarsArray[1],123); 
        
        Now here's my question. When I'm backtesting my strategy, I would like to see the custom indicator (Using the 2nd time serie) value plotted on the backtesting chart.

        As far as I now I cannot add it in Initialize(), because BarsArray is not available there.
        I also cannot use the Add() method in OnBarUpdate() to add the indicator.

        What would be the correct way to display a custom indicator from another timeserie in the backtesting chart?

        Thanks in advance!
        You can always use the method that we worked out about 2 years ago. This post explains it:

        ref: http://www.ninjatrader.com/support/f...52&postcount=3 .

        You may want to read the entire thread:

        ref: http://www.ninjatrader.com/support/f...ses#post310489

        Comment

        Latest Posts

        Collapse

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