Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Difference in output window for real-time vs. backtesting

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

    Difference in output window for real-time vs. backtesting

    I'm trying to figure out why the output window works differently in real-time vs. backtest mode.

    In the strategy code the primary bars (BIP ==0) are 20 tick bars and BIP ==1 are 1 day bars.
    The indicator in the code below, TDmean, is calculated off of BIP ==1 (1 day bars).

    When I set the statement below with BIP ==1 (1 day bars) then I get the same output in both real-time and backtest mode - which is what I would expect.

    When I set the statement below with BIP ==0 (20 tick bars) for backtest mode, the daily value repeats itself with every 20-tick bar as expected. However, when I run the exact same code in real-time mode my indicator values = 0. I've tried this with about a dozen indicators and the same problem occurs.

    I'm looking for confirmation of each indicator value on each 20-tick bar, not 1x per day. Why isn't the output window picking this up?



    if (BarsInProgress == 0)
    {
    Print( " S!: Time " + Time[0].ToString("MM-dd-yyyy HH:mm:ss") +
    " Bar " + BarsArray[1].CurrentBar.ToString() +
    " TDmean " + trendMean.ToString());

    }

    #2
    bluelou, this is expected as the intra daily bar formation is unfortunately not known in backtesting, thus you would not be able to access the developing TDmean value then. This is of course different testing realtime or on Market Replay data, as you would indeed have the intrabar formation of the daily bars then.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      bluelou, this is expected as the intra daily bar formation is unfortunately not known in backtesting, thus you would not be able to access the developing TDmean value then. This is of course different testing realtime or on Market Replay data, as you would indeed have the intrabar formation of the daily bars then.

      No, the OPPOSITE is happening. The tick bar values are correct in backtesting but they are displayed as "0" in real-time. The daily bar formation should be irrelevant since Close[0] for a daily bar is the prior day's close.

      Comment


        #4
        bluelou, sorry don't follow you - you state your indicator TDMean is calculated on daily bars - so from whatever series you access the value in backtesting - there's no intrabar formation available and hence you only see the value updated once per day as the historical daily bar updates.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Yes, I think there's some confusion here.

          So, if a value updates once per day then if the output window is set for 20 ticks/bar then we should just see the prior days' value on every 20 tick bar during the current day. And, in backtest mode, this is exactly what happens. but, in real-time mode the indicator output always = 0.

          The problem with this is as follows:
          Some of my strategy code combines tick bar indicators with day bar indicators. When backtesting, and using a 20-tick bar setting for the output window, my combined indicator output appears correctly on each 20-tick bar. But, when trading real-time, I can't see the combined indicator value in the 20-tick bar output window - I just see a 0 value.

          Comment


            #6
            bluelou, I believe you're working on 6.5 - in this case it's important that the added series have lower granularity, as per this sample - http://www.ninjatrader.com/support/f...ead.php?t=6652
            BertrandNinjaTrader Customer Service

            Comment


              #7
              No, I'm using NT7 build #20. So, what does that mean?
              Last edited by bluelou; 08-19-2010, 01:29 PM.

              Comment


                #8
                Then it would not matter in which order you Add the bars objects, please just try this real simple strategy sample attached - it prints the 10 day SMA value from your primary chart, I was using a 20 Tick ES Sep chart and the values were returned as expected.
                Attached Files
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Printing Indicator values in output window

                  Is is possible to print to the output window the date and the corresponding indicator value using code? I have a 10 year daily data series and want to get the individual values for each day.

                  Regards and thanks

                  Comment


                    #10
                    everington_f, yes that would be possible. Please see a simple example with the RSI indicator attached.
                    Attached Files
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Thankyou Bertrand... that is perfect.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by yertle, Yesterday, 08:38 AM
                      7 responses
                      28 views
                      0 likes
                      Last Post yertle
                      by yertle
                       
                      Started by bmartz, 03-12-2024, 06:12 AM
                      2 responses
                      20 views
                      0 likes
                      Last Post bmartz
                      by bmartz
                       
                      Started by funk10101, Today, 12:02 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post funk10101  
                      Started by gravdigaz6, Yesterday, 11:40 PM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by MarianApalaghiei, Yesterday, 10:49 PM
                      3 responses
                      10 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Working...
                      X