Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.

    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 Brevo, Today, 01:45 AM
      0 responses
      3 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      239 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      6 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Working...
      X