• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 chazyang, Today, 08:11 AM
                      1 response
                      4 views
                      0 likes
                      Last Post NinjaTrader_PatrickG  
                      Started by Erwin Beckers, 11-04-2018, 02:39 AM
                      6 responses
                      78 views
                      2 likes
                      Last Post koganam
                      by koganam
                       
                      Started by sergey_z, Today, 02:34 AM
                      3 responses
                      14 views
                      0 likes
                      Last Post NinjaTrader_PaulH  
                      Started by frankduc, Today, 05:24 AM
                      5 responses
                      20 views
                      0 likes
                      Last Post NinjaTrader_PaulH  
                      Started by shmarola, Today, 01:01 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post shmarola  
                      Working...
                      X