• 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

emini rth close

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

    emini rth close

    Code:
    int barsAgo = CurrentBar - Bars.GetBar(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 30, 0));
    above gets my the open for today

    how can i get the close for yesterday at 1600??

    int barsAgo = CurrentBar[1] - Bars.GetBar(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 16, 00, 0)); // doesnt compile

    basically im trying to create a gapup/down strat. and priordayohl doesnt work b/c for emini those are not based on rth

    #2
    Originally posted by calhawk01 View Post
    Code:
    int barsAgo = CurrentBar - Bars.GetBar(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 30, 0));
    above gets my the open for today

    how can i get the close for yesterday at 1600??

    int barsAgo = CurrentBar[1] - Bars.GetBar(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 16, 00, 0)); // doesnt compile

    basically im trying to create a gapup/down strat. and priordayohl doesnt work b/c for emini those are not based on rth

    Hi calhawk01,

    Try adding day bars as a second chart array.

    Add(PeriodType.Day, 1);

    Then call the secondary Close series.

    Close[1][1] or Close[1][0] depending on your settings.

    This should allow you to access the close - open gaps as far back as you like.

    Note: I believe day bars are always RTH. Check and confirm.

    RJay
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    Comment


      #3
      Hello calhawk01,

      I believe you want to use "CurrentBars[1]" for this so that you can compile it.

      http://www.ninjatrader.com/support/h...urrentbars.htm

      Code:
      int barsAgo = CurrentBars[1] - Bars.GetBar(new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 16, 00, 0));
      But I am not sure what your secondary Data Series is. Note that if you want to view the RTH Data Series and have the PriorDayOHLC values for the RTH session you can change the Data Series to use the CME US Index Futures RTH.

      Using Daily bars may also work but it depends on the Data Provider on what time they use for the their Daily Data. For example Kinetick uses ETH but CQG will use RTH.

      Happy to be of further assistance.
      JCNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by StevenNelson, Today, 12:29 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by anupsoni, Today, 12:23 PM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by aligator, Yesterday, 12:15 PM
      7 responses
      61 views
      0 likes
      Last Post aligator  
      Started by frankduc, Today, 11:22 AM
      3 responses
      8 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by aslane, Today, 10:53 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X