Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market replay becomes very slow when trading in high frequency

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

    Market replay becomes very slow when trading in high frequency

    Hi,
    I have a strategy that executes 300-400 trades per day.

    I noticed that when I run a market replay for e.g. 1 month...the replay becomes very sluggish at some point. I think that the more trades it has made as a whole, the slower it gets.

    Is there any advice on how I can avoid this problem? Or at least partially solve it (e.g. delete some log files while the market replay is still going so It could speed up)?

    Thanks

    #2
    Hello nikolaalx,

    Thank you for your post.

    You can try a few different items:
    • Mare sure no other workspaces are open but your Market Replay test workspaces.
    • Reduce any Log() and Print() methods in your code.
    • If you call indicators from the strategy that Draw please reduce these as well.

    You can take a look at our performance tips at the following link: http://www.ninjatrader.com/support/h...ance_tips2.htm

    Each instance of Market Replay will create new executions and the stored executions will be removed on disconnect and reconnect.

    Comment


      #3
      Nope.. Nothing you can do.

      look at your memory usage and swap file. It should be out of control.

      RESTART NT every Market Replay also. Else it just piles on.

      Here's a good thread that's related:

      Last edited by sledge; 04-15-2015, 05:08 PM.

      Comment


        #4
        Has nothing to do with how many trades.The reason is probably some poorly coded indicator that you use with the strategy.

        Comment


          #5
          Originally posted by outsource View Post
          Has nothing to do with how many trades.The reason is probably some poorly coded indicator that you use with the strategy.
          Run the code in the link I posted from Marcow, no poorly coded indicator involved.

          Comment


            #6
            Originally posted by sledge View Post
            Run the code in the link I posted from Marcow, no poorly coded indicator involved.
            I have a strategy and an indicator both 10K lines of code + up to 100 limit orders in quantity,plus 4 years of replay data,and i`ve replayed about 100 years,if combined,with different indicators.The only time i had an issue when i put some ugly coded script into strategy.

            Comment


              #7
              Originally posted by outsource View Post
              I have a strategy and an indicator both 10K lines of code + up to 100 limit orders in quantity,plus 4 years of replay data,and i`ve replayed about 100 years,if combined,with different indicators.The only time i had an issue when i put some ugly coded script into strategy.
              And how many trades total? Creating 100 limit orders has nothing to do with this.


              The crossover strategy was just about that - # of trades. Too much memory consumed by NinjaTrader creating objects on charts.


              Oh - for the original poster - you might try to run without a chart.. just put the strategy in the control panel. (I haven't done any full testing with this,but it kind of defeats the purpose to verify).

              Comment


                #8
                Originally posted by outsource View Post
                I have a strategy and an indicator both 10K lines of code + up to 100 limit orders in quantity,plus 4 years of replay data,and i`ve replayed about 100 years,if combined,with different indicators.The only time i had an issue when i put some ugly coded script into strategy.
                Here's the CODE...

                no indicators.

                REPLAY THAT!

                This is HIGH FREQUENCY to the MAX.

                Code:
                namespace NinjaTrader.Strategy
                {
                    /// <summary>
                    /// Enter the description of your strategy here
                    /// </summary>
                    [Description("Enter the description of your strategy here")]
                    public class ReplayCrash : Strategy
                    {
                        #region Variables
                        // Wizard generated variables
                       			
                        // User defined variables (add any user defined variables below)
                        #endregion
                
                        /// <summary>
                        /// This method is used to configure the strategy and is called once before any strategy method is called.
                        /// </summary>
                        protected override void Initialize()
                        {
                            SetProfitTarget("", CalculationMode.Ticks, 2);
                
                            BarsRequired = 2;
                			ExitOnClose = false;
                			CalculateOnBarClose = true;
                			
                        }
                
                        /// <summary>
                        /// Called on each bar update event (incoming tick)
                        /// </summary>
                        protected override void OnBarUpdate()
                        {
                            
                			if  ( Close[0] > Close[1] )
                				EnterLong(DefaultQuantity, "");
                			
                			if  ( Close[0] < Close[1] )
                				EnterShort(DefaultQuantity, "");
                				
                			
                		}
                
                        #region Properties

                Comment


                  #9
                  Originally posted by sledge View Post
                  And how many trades total? Creating 100 limit orders has nothing to do with this.


                  The crossover strategy was just about that - # of trades. Too much memory consumed by NinjaTrader creating objects on charts.


                  Oh - for the original poster - you might try to run without a chart.. just put the strategy in the control panel. (I haven't done any full testing with this,but it kind of defeats the purpose to verify).
                  Can`t remember exactly how many,but you can do ZZ test on a 5M chart and see.I used simple ZZ indicator with the strategy.

                  Could be easily a couple of thouthands,without any issues.

                  What drawing objects have to do with the xover indicator,btw?

                  Comment


                    #10
                    Originally posted by sledge View Post
                    Here's the CODE...

                    no indicators.

                    REPLAY THAT!

                    This is HIGH FREQUENCY to the MAX.

                    Code:
                    namespace NinjaTrader.Strategy
                    {
                        /// <summary>
                        /// Enter the description of your strategy here
                        /// </summary>
                        [Description("Enter the description of your strategy here")]
                        public class ReplayCrash : Strategy
                        {
                            #region Variables
                            // Wizard generated variables
                           			
                            // User defined variables (add any user defined variables below)
                            #endregion
                    
                            /// <summary>
                            /// This method is used to configure the strategy and is called once before any strategy method is called.
                            /// </summary>
                            protected override void Initialize()
                            {
                                SetProfitTarget("", CalculationMode.Ticks, 2);
                    
                                BarsRequired = 2;
                    			ExitOnClose = false;
                    			CalculateOnBarClose = true;
                    			
                            }
                    
                            /// <summary>
                            /// Called on each bar update event (incoming tick)
                            /// </summary>
                            protected override void OnBarUpdate()
                            {
                                
                    			if  ( Close[0] > Close[1] )
                    				EnterLong(DefaultQuantity, "");
                    			
                    			if  ( Close[0] < Close[1] )
                    				EnterShort(DefaultQuantity, "");
                    				
                    			
                    		}
                    
                            #region Properties

                    thx,my dearrr,

                    come gimme hug

                    Comment


                      #11
                      Originally posted by outsource View Post
                      thx,my dearrr,

                      come gimme hug
                      There's nothing more for to prove... it's been tested.. been there done that.

                      I'm not sure what is happening on NT's end but they've got a memory leak or something going on....and it surely won't be addressed at this point with NT8 on the horizon...

                      And I do think 300-400 trades a day is nuts.

                      I'll stay at 100 trades a year... takes 12 hours to market replay.


                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by kaywai, Today, 06:26 AM
                      1 response
                      6 views
                      0 likes
                      Last Post kaywai
                      by kaywai
                       
                      Started by ct, 05-07-2023, 12:31 PM
                      6 responses
                      203 views
                      0 likes
                      Last Post wisconsinpat  
                      Started by kevinenergy, 02-17-2023, 12:42 PM
                      118 responses
                      2,780 views
                      1 like
                      Last Post kevinenergy  
                      Started by briansaul, Today, 05:31 AM
                      0 responses
                      10 views
                      0 likes
                      Last Post briansaul  
                      Started by traderqz, Yesterday, 12:06 AM
                      11 responses
                      28 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Working...
                      X