Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Copying a DataSeries confuses indicators

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

    Copying a DataSeries confuses indicators

    Hi,

    I haven't seen this exact problem mentioned anywhere. If I've missed it please direct me in the right direction. The attached strategy demonstrates the issue I'm having. It doesn't trade, it just uses Print() a lot. Here's a brief extract from the output (N.B. I'm from the UK).

    New $EURUSD bar at 08/04/2013 16:07:22, Bar time = 12/03/2012 21:00:00, OHLC = 1.3101, 1.3158, 1.3078, 1.3153, RSI1 47.3815621983981, RSI2 71.6585753392596
    Bar 0 - Close1 = 1.3153, Close2 = 1.3153
    Bar 1 - Close1 = 1.3116, Close2 = 1.3116
    Bar 2 - Close1 = 1.3271, Close2 = 1.3271
    Bar 3 - Close1 = 1.3148, Close2 = 1.3148
    Bar 4 - Close1 = 1.311, Close2 = 1.311
    Bar 5 - Close1 = 1.3215, Close2 = 1.3215
    Bar 6 - Close1 = 1.3198, Close2 = 1.3198
    Bar 7 - Close1 = 1.3308, Close2 = 1.3308
    Bar 8 - Close1 = 1.3323, Close2 = 1.3323
    Bar 9 - Close1 = 1.3455, Close2 = 1.3455
    Bar 10 - Close1 = 1.3396, Close2 = 1.3396
    Bar 11 - Close1 = 1.3446, Close2 = 1.3446
    Bar 12 - Close1 = 1.3371, Close2 = 1.3371
    Bar 13 - Close1 = 1.3245, Close2 = 1.3245

    Basically I copy Close into myClose but get different answers when I RSI the two DataSeries. Where am I going wrong?

    Jim
    Attached Files

    #2
    Hello Jim,

    Thank you for your post.

    I have tested your strategy and the RSI1 matches the RSI2 in the Output window.

    Please advise if there is additional strategy logic you have removed from the strategy before attaching to your post.

    Comment


      #3
      Hi Patrick,

      That's interesting, because that's not what I found in my own experiments.

      I "backtested" the "strategy" on historical daily bars of EUR/USD, whilst not connected to any data feed. In order that I might try and reproduce your results, perhaps you could explain exactly what you did?

      Thanks,

      Jim

      Comment


        #4
        Hello Jim,

        Thank you for that information.

        Testing in real-time and via backtest return the correct results:
        New ES 06-13 bar at 4/8/2013 10:05:58 AM, Bar time = 4/8/2013 10:02:00 AM, OHLC = 1546.25, 1546.75, 1546.25, 1546.25, RSI1 44.3456298428981, RSI2 44.3456298428981
        New ES 06-13 bar at 4/8/2013 10:05:58 AM, Bar time = 4/8/2013 10:03:00 AM, OHLC = 1546.5, 1547.25, 1546.25, 1547, RSI1 51.618062170484, RSI2 51.618062170484
        New ES 06-13 bar at 4/8/2013 10:05:58 AM, Bar time = 4/8/2013 10:04:00 AM, OHLC = 1546.75, 1547, 1546.5, 1546.5, RSI1 47.1908378373787, RSI2 47.1908378373787
        New ES 06-13 bar at 4/8/2013 10:05:58 AM, Bar time = 4/8/2013 10:05:00 AM, OHLC = 1546.5, 1547, 1546.5, 1546.5, RSI1 47.1908378373787, RSI2 47.1908378373787
        What instrument are you backtesting? What period type? What interval? And what from and to date is selected?

        I look forward to your response.

        Comment


          #5
          Hi Patrick,

          I was looking at EUR/USD daily bars in the Strategy Analyzer over the whole of 2012.

          To try and reproduce your results I connected to Interactive Brokers and set Strategy Analyzer off testing one minute bars of ES for today only. After the data had downloaded this is what I saw in my "Output" window:

          New ES 06-13 bar at 08/04/2013 18:00:45, Bar time = 07/04/2013 23:51:00, OHLC = 1547.25, 1547.75, 1547.25, 1547.5, RSI1 48.5153301310517, RSI2 98.6657530511531
          Bar 0 - Close1 = 1547.5, Close2 = 1547.5
          Bar 1 - Close1 = 1547.25, Close2 = 1547.25
          Bar 2 - Close1 = 1547.5, Close2 = 1547.5
          Bar 3 - Close1 = 1547.75, Close2 = 1547.75
          Bar 4 - Close1 = 1548, Close2 = 1548
          Bar 5 - Close1 = 1547.5, Close2 = 1547.5
          Bar 6 - Close1 = 1547.5, Close2 = 1547.5
          Bar 7 - Close1 = 1547.5, Close2 = 1547.5
          Bar 8 - Close1 = 1547.5, Close2 = 1547.5
          Bar 9 - Close1 = 1547.5, Close2 = 1547.5
          Bar 10 - Close1 = 1547.75, Close2 = 1547.75
          Bar 11 - Close1 = 1547.75, Close2 = 1547.75
          Bar 12 - Close1 = 1547.75, Close2 = 1547.75
          Bar 13 - Close1 = 1548, Close2 = 1548

          Then I opened up a one minute chart of ES and attached the strategy. This is what I then saw in my "Output" window:

          New ES 06-13 bar at 08/04/2013 18:07:53, Bar time = 02/04/2013 23:06:00, OHLC = 1565.25, 1565.5, 1565.25, 1565.5, RSI1 51.0956825712073, RSI2 99.0174343601131
          Bar 0 - Close1 = 1565.5, Close2 = 1565.5
          Bar 1 - Close1 = 1565.25, Close2 = 1565.25
          Bar 2 - Close1 = 1565.5, Close2 = 1565.5
          Bar 3 - Close1 = 1565.5, Close2 = 1565.5
          Bar 4 - Close1 = 1565.5, Close2 = 1565.5
          Bar 5 - Close1 = 1565.5, Close2 = 1565.5
          Bar 6 - Close1 = 1566, Close2 = 1566
          Bar 7 - Close1 = 1566, Close2 = 1566
          Bar 8 - Close1 = 1565.75, Close2 = 1565.75
          Bar 9 - Close1 = 1565.75, Close2 = 1565.75
          Bar 10 - Close1 = 1566, Close2 = 1566
          Bar 11 - Close1 = 1566, Close2 = 1566
          Bar 12 - Close1 = 1565.75, Close2 = 1565.75
          Bar 13 - Close1 = 1565.75, Close2 = 1565.75

          An intriguing difference between my experience and your own, would you not agree?

          For the record my version of NinjaTrader claims to be: 7.0.1000.12 and my .NET/CLR says: 2.0.50727.3053

          Comment


            #6
            Hello Jim,

            Thank you for your response.

            Please shut down NinjaTrader and then go to the following directory on your PC: (My) Documents\NinjaTrader 7\db

            Then delete the 'cache' folder within the 'db' folder. Restart NinjaTrader and advise if you still see the same results as before.

            Comment


              #7
              Hi Patrick,

              I've tried that now, but the problem remains at this end. After deleting the cache, on a chart:

              New ES 06-13 bar at 08/04/2013 20:38:31, Bar time = 02/04/2013 23:06:00, OHLC = 1565.25, 1565.5, 1565.25, 1565.5, RSI1 51.0956825712073, RSI2 99.0174343601131
              Bar 0 - Close1 = 1565.5, Close2 = 1565.5
              Bar 1 - Close1 = 1565.25, Close2 = 1565.25
              Bar 2 - Close1 = 1565.5, Close2 = 1565.5
              Bar 3 - Close1 = 1565.5, Close2 = 1565.5
              Bar 4 - Close1 = 1565.5, Close2 = 1565.5
              Bar 5 - Close1 = 1565.5, Close2 = 1565.5
              Bar 6 - Close1 = 1566, Close2 = 1566
              Bar 7 - Close1 = 1566, Close2 = 1566
              Bar 8 - Close1 = 1565.75, Close2 = 1565.75
              Bar 9 - Close1 = 1565.75, Close2 = 1565.75
              Bar 10 - Close1 = 1566, Close2 = 1566
              Bar 11 - Close1 = 1566, Close2 = 1566
              Bar 12 - Close1 = 1565.75, Close2 = 1565.75
              Bar 13 - Close1 = 1565.75, Close2 = 1565.75

              In Strategy Analyzer:

              New ES 06-13 bar at 08/04/2013 20:42:33, Bar time = 07/04/2013 23:51:00, OHLC = 1547.25, 1547.75, 1547.25, 1547.5, RSI1 48.5153301310517, RSI2 98.6657530511531
              Bar 0 - Close1 = 1547.5, Close2 = 1547.5
              Bar 1 - Close1 = 1547.25, Close2 = 1547.25
              Bar 2 - Close1 = 1547.5, Close2 = 1547.5
              Bar 3 - Close1 = 1547.75, Close2 = 1547.75
              Bar 4 - Close1 = 1548, Close2 = 1548
              Bar 5 - Close1 = 1547.5, Close2 = 1547.5
              Bar 6 - Close1 = 1547.5, Close2 = 1547.5
              Bar 7 - Close1 = 1547.5, Close2 = 1547.5
              Bar 8 - Close1 = 1547.5, Close2 = 1547.5
              Bar 9 - Close1 = 1547.5, Close2 = 1547.5
              Bar 10 - Close1 = 1547.75, Close2 = 1547.75
              Bar 11 - Close1 = 1547.75, Close2 = 1547.75
              Bar 12 - Close1 = 1547.75, Close2 = 1547.75
              Bar 13 - Close1 = 1548, Close2 = 1548

              Comment


                #8
                Hello Jim,

                Thank you for your response.

                Please send me your log and trace files for today so that I may look into what is occurring.

                You can do this by going to the Control Center-> Help-> Mail to Support.

                Please place 'ATTN: Patrick - 823264' in the subject line and reference this thread in the body of the email: http://www.ninjatrader.com/support/f...ad.php?t=57081

                I look forward to your response.

                Comment


                  #9
                  Hi Patrick,

                  I'm not sure quite how it will help, but I've done as you ask. I've also included a dump of my output window. Basically I just repeated what I did yesterday.

                  1. Deleted cache directory
                  2. Started NinjaTrader
                  3. Connected to IB
                  4. Ran a one minute ES backtest for today
                  5. Enabled the strategy on a one minute ES chart and waited for one "live" bar
                  6. Closed NinjaTrader

                  Jim

                  Comment


                    #10
                    Hello Jim,

                    Thank you for that information.

                    I will investigate this matter on my end and follow up with you via e-mail.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by sjsj2732, Yesterday, 04:31 AM
                    0 responses
                    32 views
                    0 likes
                    Last Post sjsj2732  
                    Started by NullPointStrategies, 03-13-2026, 05:17 AM
                    0 responses
                    286 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    283 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    133 views
                    1 like
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    91 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Working...
                    X