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 cmoran13, Yesterday, 01:02 PM
                0 responses
                31 views
                0 likes
                Last Post cmoran13  
                Started by PaulMohn, 04-10-2026, 11:11 AM
                0 responses
                22 views
                0 likes
                Last Post PaulMohn  
                Started by CarlTrading, 03-31-2026, 09:41 PM
                1 response
                162 views
                1 like
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 04-01-2026, 02:41 AM
                0 responses
                95 views
                1 like
                Last Post CarlTrading  
                Started by CaptainJack, 03-31-2026, 11:44 PM
                0 responses
                151 views
                2 likes
                Last Post CaptainJack  
                Working...
                X