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.



      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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      576 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X