• 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

Market Replay - Controlling date and time of data for analysis

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

    Market Replay - Controlling date and time of data for analysis

    Hi there,

    I'm pretty sure there's a simple solution for this, but I haven't figured it out yet.

    Basically, I'm running a Ninjascript strategy using Market Replay on a particular date in December of 2012. I have the day set up so that it only shows one day of data (and not the past 2-3 days as a consideration).

    For some reason, I have a one 20-tick bar data artifact that was recorded two days previous (ex: 12/17/2012 is the first tick bar, the second tick bar on the chart is from 12/19/2012). Since I don't have any filters in my script to ignore that older tick bar, it skews all of me EMA averages to the upside (ex: the tick bar value on 12/17 is 50, but the tick bar value on bar #2 for 12/19 is 56).

    So, is there a simple way to isolate the day/time of *recorded* data for a particular day captured in Market Replay via code in an Ninjascript strategy?

    I'll restate that in the 'Data Series' window, days to load is 0, and the End Date is 12/19/2012. The session template is defaulted to <Use Instrument Settings>. Would I have to make a session template to isolate that one tick bar out of the equation?

    Thanks in advance for any replies!

    Yours,
    Spider

    #2
    Hello Spiderbird,

    Thank you for your note.
    Originally posted by Spiderbird View Post
    So, is there a simple way to isolate the day/time of *recorded* data for a particular day captured in Market Replay via code in an Ninjascript strategy?

    I'll restate that in the 'Data Series' window, days to load is 0, and the End Date is 12/19/2012. The session template is defaulted to <Use Instrument Settings>. Would I have to make a session template to isolate that one tick bar out of the equation?
    You can add a check to the beginning of your OnBarUpdate() method to ensure the bars are the same date:
    Code:
    			if (Time[0].Day != Time[1].Day)
    				return;
    For information on Time please visit the following link: http://www.ninjatrader.com/support/h...s/nt7/time.htm

    You should not need to create a special Session Template to exclude this erroneous bar. Can you attach a screenshot of this bar to your response?

    I look forward to assisting you further.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Thanks!

      Hi Patrick!

      Thanks for your response!

      Your bit of code didn't work, but something else did. Went back into the 'Data Series' dialog box corresponding to the chart I was looking at, and changed the 'Data > Load Data based on' drop-down to a custom range (Start 12/19/2012 - End 12/19/2012) and that eliminated that pesky one tick bar from two days previous.

      The included link below is the image is the dialog box I'm referring to that I needed to change.

      https://app.box.com/s/53p9dc0pe0kvfmg411d7

      Thanks again for your time!

      Yours,
      Spider
      Last edited by Spiderbird; 07-29-2013, 12:01 AM. Reason: Image link wouldn't work. Changed to plain link.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sdauteuil, Today, 11:02 PM
      1 response
      2 views
      0 likes
      Last Post sdauteuil  
      Started by Jschmelz, Today, 04:45 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Marco  
      Started by sisenberg, Today, 08:06 PM
      1 response
      8 views
      0 likes
      Last Post sisenberg  
      Started by priceisking, Today, 07:44 PM
      0 responses
      5 views
      0 likes
      Last Post priceisking  
      Started by saltminer, Today, 06:06 PM
      0 responses
      5 views
      0 likes
      Last Post saltminer  
      Working...
      X