Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to run strategy in Real Time

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

    How to run strategy in Real Time

    Hi,

    I've developed a multiple instrument strategy that run fine from the strategy analyzer. However, when I tried to run it in real time from a chart or from the control center, nothing seems to be happening. I am outputting debugging information and it looks like the strategy never starts.

    Thanks.

    #2
    Check the log? Any errors?
    RayNinjaTrader Customer Service

    Comment


      #3
      Error in log

      Yes,

      I see an error in the log. The message is:

      "Error on calling 'OnBarUpdate' method for strategy 'XXX_Spread': Object reference not set to an instance of an object."

      Comment


        #4
        Then there is a logic flaw in your strategy, somewhere you are accessing a variable/property/method that does not hold an object.

        Here is more info that will help you to debug - http://www.ninjatrader-support.com/v...ead.php?t=4226
        RayNinjaTrader Customer Service

        Comment


          #5
          Thanks. I am able to get it to run partially now. Is there a limit on the number of characters the output window can handle? The strategy seems to start from the beginning of time. If I limit it to one day, the strategy runs. Is there a way to enter and exit positions only when it is from the current time or later?

          Comment


            #6
            if (Historical) return;
            RayNinjaTrader Customer Service

            Comment


              #7
              Thanks. Do you have a suggestion on how to recognize if a strategy is being from from the strategy analyzer versus being run from a chart in real time?

              If I have the historical statement in place, I can not backtest my strategy. I would hate to have two copies of the same strategy.

              Comment


                #8
                Create a bool property that you can set at run time to say whether or not it is a backtest or not.
                RayNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

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