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 SalmaTrader, 07-07-2026, 10:26 PM
                0 responses
                47 views
                0 likes
                Last Post SalmaTrader  
                Started by CarlTrading, 07-05-2026, 01:16 PM
                0 responses
                22 views
                0 likes
                Last Post CarlTrading  
                Started by CaptainJack, 06-17-2026, 10:32 AM
                0 responses
                15 views
                0 likes
                Last Post CaptainJack  
                Started by kinfxhk, 06-17-2026, 04:15 AM
                0 responses
                21 views
                0 likes
                Last Post kinfxhk
                by kinfxhk
                 
                Started by kinfxhk, 06-17-2026, 04:06 AM
                0 responses
                23 views
                0 likes
                Last Post kinfxhk
                by kinfxhk
                 
                Working...
                X