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 CaptainJack, 05-29-2026, 05:09 AM
                0 responses
                262 views
                0 likes
                Last Post CaptainJack  
                Started by CaptainJack, 05-29-2026, 12:02 AM
                0 responses
                168 views
                0 likes
                Last Post CaptainJack  
                Started by charlesugo_1, 05-26-2026, 05:03 PM
                0 responses
                170 views
                1 like
                Last Post charlesugo_1  
                Started by DannyP96, 05-18-2026, 02:38 PM
                1 response
                257 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 05-11-2026, 05:56 AM
                0 responses
                209 views
                0 likes
                Last Post CarlTrading  
                Working...
                X