Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Log Errors

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

    Log Errors

    Hi guys

    This one relates to a couple of questions, one is that i keep getting this message in the log file for my strategy:

    2009-05-31 16:07:11:668 ERROR: The strategy 'SampleMultiInstrument' has called the Add() method with an invalid instrument. Either 'ES 12-08' does not exist in the Instrument Manager or the specified exchange has not been configured.

    I have no idea where this is coming from or what is generating it? Are you able to point me in the correct direction?

    The only adds I'm doing in my strat are below:

    Add(PeriodType.Tick, 1);

    Add(Bollinger(bstandev, bperiod));

    It has been around since my strat creation and before i added the tick bar series so i can only assume it's related to the bollinger bands addition somehow.

    My other question is that i'm having a problem running my strategy in the optimizer even though it runs no problem in backtest and also runs without a problem in live.

    The error that is coming out in the log is the following:

    31/05/2009 16:00 Strategy Error on calling 'OnBarUpdate' method for strategy 'RNB30MultiTimeFrame': Object reference not set to an instance of an object.

    Any ideas on that one? Sorta stuck at the minute.

    Thanks for any help.
    Ross

    #2
    For more info I have come across a couple of other posts on the forum referring to using Repair DB to sort the problem with the "object reference" error on optimization, i have tried that and it didn't help, although I have another machine also running ninja and have the same problem there so wouldn't think it's a database issue.

    I've also tried to optimzse a different currency and data period to make sure it's not an issue in my data set and still i have the error.

    Ross

    Comment


      #3
      Ok guys, so as to try be as helpful as possible, i've gone through my source code and stuck Print all over the place referencing the line of source the Print area is at so that i can effectively find out where it's breaking down with this "object reference not set to an instance of an object" error.

      It is this piece of code here that is crashing the optimizer.

      Print(464);

      //Spin tops and shooting stars with slight bodies
      if (CheckSpinningTopInt==2)
      {
      if(High[0]>High[1])
      {
      Print(+ CurrentBar);
      Print(471);
      ChartControl.BarColorSeries[CurrentBar] = Color.Blue;

      Print(475);

      goShort=1;
      }
      }

      Print(477);


      Oddly enough I was expecting it to be something to do with my really overly complicated set of order handling rules that I've got going but it seems that the ChartControl.BarColorSeries function is crashing it, either that or the reference to CurrentBar, although I've printed current bar and it's showing me a value of 26, which is correct if I look at my backtest chart, it's on bar 26 that I have a spinning top that is set to blue and a signal is fired. However in optimizer it's here that we get the object reference exception and the code then ceases to continue.

      Does optimizer not support chartcontrol or something? i searched on the forums but couldn't find anything on this.

      Cheers
      Ross

      Comment


        #4
        Hello,

        To change bar colors use BarColor:
        DenNinjaTrader Customer Service

        Comment


          #5
          Excellent that sorted it. Thanks, I was certain it was something with that as i had just added a paintsignals parameter which when i switched off my optimizing was working fine as that piece of code was then on an if condition. Obviously my own invalid use of colour changing on the bars.

          Any ideas on the:

          The strategy 'SampleMultiInstrument' has called the Add() method with an invalid instrument. Either 'ES 12-08' does not exist in the Instrument Manager or the specified exchange has not been configured.

          This has been here since the start of my strat, seems to cause no known problems but it's always in the log when I run it so would love to know why it's there.

          Thanks for the Sunday response. Top stuff from NT support as always.

          Ross

          Comment


            #6
            Hello,

            I'm not sure, start by looking at the code of SampleMultiInstrument. Check out the Add()'s.
            DenNinjaTrader Customer Service

            Comment


              #7
              ah got it, it seems that strategy is trying to add a 1 minute bar series on initialisation for ES12-09 which i have removed from my default list of instruments in instrument manager, so it's not finding it.

              So I think the thing that threw me is why is that strat executing every time I start my own strat when it's in a completely unrelated strat?

              If I want to get rid of this it won't let me because it says i cannot save or delete a system strat?

              This is not really causing me a prob but for my own understanding would be good to know what it's trying to do. Also I don't like my log having unrelated errors.

              Cheers
              Ross

              Comment


                #8
                As you go into the strategy selection dialogue window, all strategies' Initialize() method are fired off and that is where you get the message from.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Belfortbucks, Today, 09:29 PM
                0 responses
                3 views
                0 likes
                Last Post Belfortbucks  
                Started by zstheorist, Today, 07:52 PM
                0 responses
                7 views
                0 likes
                Last Post zstheorist  
                Started by pmachiraju, 11-01-2023, 04:46 AM
                8 responses
                150 views
                0 likes
                Last Post rehmans
                by rehmans
                 
                Started by mattbsea, Today, 05:44 PM
                0 responses
                6 views
                0 likes
                Last Post mattbsea  
                Started by RideMe, 04-07-2024, 04:54 PM
                6 responses
                33 views
                0 likes
                Last Post RideMe
                by RideMe
                 
                Working...
                X