Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug in Pairs Suite / NinjaTrader 7.0

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

    Bug in Pairs Suite / NinjaTrader 7.0

    I have downloaded the Pairs Suite coded by NinjaTrader Tim. I would just like to point out that this set of indicators throws exceptions, when I open a Renko chart.

    As the bug resides in the Initialize Section() of the indicator, the exceptions will be thrown, even if the indicators are not added to any chart.

    The error message is

    Failed to call method 'Initilialize' for Indicator 'Spread3'. Please use alternate method 'AddRenko() instead of Add()

    If you look at the code,

    Code:
    protected override void Initialize()
    {
          Add(new Plot(Color.Orange, "Ratio"));
                
         Add(FirstInstrument, BarsPeriods[0].Id, BarsPeriods[0].Value);
         Add(SecondInstrument, BarsPeriods[0].Id, BarsPeriods[0].Value);
    }
    it is obvious that it will not work, if the first BarSeries is a Renko series.

    To correct this, you would have to check first, whether the first BarSeries is an exotic series that requires something like AddRenko() or similar instead of Add().

    How can this be done, that is how can the exceptions been avoided and how can the indicator be modified to work with all bar types?

    #2
    Hi Harry,

    I will take a look and see what I can come up with. I will update you once I find something
    TimNinjaTrader Customer Service

    Comment


      #3
      Hi Tim,

      thank you for your answer. By the way the spread indicators by kdoren suffer from the same behaviour (see screenshot attached). To reproduce just import and open a default Renko chart.

      Originally posted by NinjaTrader_Tim View Post
      Hi Harry,

      I will take a look and see what I can come up with. I will update you once I find something
      Attached Files

      Comment


        #4
        My indicators are designed to work with time-based bars. If you want to plot a spread on a non-time-based chart, you can use my "index" indicator; you'll need to add a time-based Data Series to the chart (can be any instrument), then select that as the "Input Series" to the indicator, and set the indicator parameters for the symbols and weights for the spread you want.

        http://www.ninjatrader.com/support/f...d=4&linkid=456
        Last edited by kdoren; 05-03-2011, 06:15 PM.

        Comment


          #5
          Originally posted by kdoren View Post
          My indicators are designed to work with time-based bars. If you want to plot a spread on a non-time-based chart, you can use my "index" indicator; you'll need to add a time-based Data Series to the chart (can be any instrument), then select that as the "Input Series" to the indicator, and set the indicator parameters for the symbols and weights for the spread you want.

          http://www.ninjatrader.com/support/f...d=4&linkid=456
          Hi kdoren, thanks for your answer.

          This is the problem: The Initialize() section of an indicator is compiled, whether the indicator is added to the chart or not.

          So if I open a Renko chart and then add a simple EMA, your indicator will thrown an exception although I have not even added it.

          Indicator problems in the Initialize() section of any indicator can actually freeze and crash NinjaTrader, as I have experienced with the jtEconNews Indicator. The crash will even occur without adding the indicator to any chart.

          The same applies to the - maybe harmless - exceptions thrown by the Pairs Suite and spread indicators.

          Comment


            #6
            Harry, thanks for pointing this out. I've attached a fixed Spread indicator (it won't actually work on a Renko chart, but at least it won't trip an error when you bring up the indicator panel on a Renko chart). Let me know if it works for you, if so I'll update it and the other indicators of mine in the indicators area. -Kevin
            Attached Files
            Last edited by kdoren; 05-05-2011, 12:39 AM.

            Comment


              #7
              Originally posted by kdoren View Post
              Harry, thanks for pointing this out. I've attached a fixed Spread indicator (it won't actually work on a Renko chart, but at least it won't trip an error when you bring up the indicator panel on a Renko chart). Let me know if it works for you, if so I'll update it and the other indicators of mine in the indicators area. -Kevin
              Hi Kevin,

              the modified version does not throw the exception. Problem solved. Can be applied to the Pairs Suite as well.

              Harry
              Last edited by Harry; 05-05-2011, 03:05 AM.

              Comment


                #8
                All,

                Thanks for investigating and finding a solution!
                TimNinjaTrader Customer Service

                Comment


                  #9
                  Hi Kevin, Tim,
                  I noticed these postings are more recent than the indicators in the indicators forum. Have they been modified to take care of the error on non-time based charts? I plan to try them on range bars. Thanks for all your work.
                  Travis

                  Comment


                    #10
                    Hello Tdschulz,

                    Thank you for your post.

                    The Pairs Trading Suite was designed to be used with time based periods. Unfortunately, it will not work with Renko bars.

                    Please let me know if I may be of further assistance.

                    Comment


                      #11
                      Hi Pat, I see from the thread that a change in the initialize section was required to avoid the error even when the indicator was not loaded on the renko chart. My question is whether the change was made to the indicators yet. I would like to have the pairs suit on a time based chart but also have a range chart open also. The thread indicates this will throw an exception.

                      Comment


                        #12
                        Hello Tdschulz,

                        Thank you for your response.

                        I tested these indicators on both a 1 minute and 4 range chart and did not receive an error.
                        However, I did receive errors on a Renko chart.

                        Please let me know if you are able to apply this indicator successfully.

                        Comment


                          #13
                          My Spread, Index, Correlation and other indicators work only on time-based bars by design. It wouldn't be very useful to plot a spread of prices that occurred at different times, which is what would happen if you tried to take a spread of range or other types of bars.

                          You can have any other kind of bars open on the same chart. You just can't use my indicators with them.

                          Comment


                            #14
                            Thanks for the feedback guys. I was trying to fit a square peg into a round hole.
                            My ultimate goal is plot the spread and show the spread changes using range bars. As Ninja doesn't naively support spreads as an input series, I'm exploring creating a chart style/indicator. For example, I want to view a 4R chart of the spread between two instruments. I would like the indicator / chart to be calculating the spread every tick change of both instruments and plotting a new bar each time the spread reaches a range of 4 ticks. This may end up being overly CPU intensive in which case maybe it's not possible. Any feedback on feasibility is appreciated.

                            Comment


                              #15
                              Hello Tdschulz,

                              Thank you for your response.

                              You will need to create your own chart type, however there is not much information or support for this.
                              You can take a look at the @BarType.cs file in your (My) Documents\NinjaTrader 7\bin\custom\type folder, to get an idea of how this may be done.

                              Please let me know if I may be of further assistance.
                              Last edited by NinjaTrader_PatrickH; 01-04-2012, 02:48 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              579 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              334 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              101 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              554 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              551 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X