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

Multi Instrument: Both Instruments Within Trading Hours?

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

    Multi Instrument: Both Instruments Within Trading Hours?

    Howdy--

    I'm interested in determining if all the instruments that I added via Initialize() are trading and not outside the instrument specific exchange trading hours.

    For instance, the ES and TF trade on different exchanges and trading hours, so when you add the TF as a secondary series to a chart, gaps appear on the TF when it's not trading and similar gas appear on the ES when it's not trading.

    So at the indicator level, when I add the TF via Initialize(), I want to test if both instruments are trading.

    Is there a special NT keyword that would identify the state of each instrument or is the only way to do this by looking at Times[0] and Times[1]?

    Thanks

    Aventeren

    #2
    Bars not lining up

    So a follow on issue that I seeing with a chart with multi instruments, is that the bars do not line up. For instance, I have a 60 min ES 09-14 chart, and I added the NQ, TF and YM 09-14 contracts on the chart in their own separate panels. The ES, NQ and YM bars all line up (maybe because they are all using the same session template?), but the TF bars are slightly offset. I have attached a screenshot of what I am seeing:

    What's going on behind the scenes that would cause the TF bar series to be offset from the other bars?

    How will these secondary bar offsets impact indicator/strategy development (i.e., do I need special code to filter out these instances somehow)?

    I'm just getting my feet wet on multiple instruments, and this is a weird one for me.

    Thanks for your help,

    Aventeren
    Attached Files

    Comment


      #3
      Hello Aventeren,

      Thank you for your post.

      There is no function to compare the added series and the main series. Using Times is a good idea in order to compare the timestamps of the series in the code.
      The reason you see misaligned bars is due to the bars closing and opening at different times per the Session Templates used for each individual instrument. You can view what each instrument uses by going to Tools > Instrument Manager > search for the instrument > then select the instrument and Edit > the Session Template is listed under the same name. You can view the session times and time zone by going to Tools > Session Manager > select the Session Template you would like to view.

      For information on Session Templates and the Session Manager please visit the following link: http://www.ninjatrader.com/support/h...on_manager.htm

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Jonafare, 12-06-2012, 03:48 PM
      5 responses
      3,985 views
      0 likes
      Last Post rene69851  
      Started by Fitspressorest, Today, 01:38 PM
      0 responses
      2 views
      0 likes
      Last Post Fitspressorest  
      Started by Jonker, Today, 01:19 PM
      0 responses
      2 views
      0 likes
      Last Post Jonker
      by Jonker
       
      Started by futtrader, Today, 01:16 PM
      0 responses
      7 views
      0 likes
      Last Post futtrader  
      Started by Segwin, 05-07-2018, 02:15 PM
      14 responses
      1,792 views
      0 likes
      Last Post aligator  
      Working...
      X