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 sjsj2732, Yesterday, 04:31 AM
                0 responses
                39 views
                0 likes
                Last Post sjsj2732  
                Started by NullPointStrategies, 03-13-2026, 05:17 AM
                0 responses
                290 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                289 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                135 views
                1 like
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                96 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Working...
                X