Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

currentDayOHL

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

    currentDayOHL

    Back again,

    I'm having a problem calculating the daily open for my bar array object at index 2 which is a 5 minute interval, is it possible to get the daily open with the CurrentDayOHL function? Trying to minimize the amount of dataseries objects I add to the script.


    Add(PeriodType.Minute,30);
    Add("SPY",PeriodType.Minute,5);
    .
    .
    .
    CurrentDayOHL(BarsArray[2]).CurrentHigh[0]);


    Thanks Again!

    #2
    slocumtrader, why are you requesting the .CurrentHigh if you're interested in the .CurrentOpen for the instrument?



    Current and Prior Day OHL((C) methods are tied to the session template hours used.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Sorry about that, I am using
      Print("SPY OPEN: " + CurrentDayOHL(BarsArray[2]).CurrentOpen[0]);

      I see what the problem is now. its using the open data from AH trading (early morning hours) so instead of using 9:30NY open time its using 6AM open/low/high data for my SPY values. Strange that when I use:

      Print("THIS OPEN: " + CurrentDayOHL().CurrentOpen[0]);

      for the open of the primary bar it uses regular 9:30NY open as its starting point and then for bar[2] it begins from premarket..

      possibly using a different session template? Thanks!

      Comment


        #4
        What session template is assigned then to your SPY master instrument under Tools > Instrument Manager? Can you try assigned the 'US Equities RTH' for example to it and then rechecking?

        Thanks,
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by trilliantrader, Today, 08:16 AM
        2 responses
        6 views
        0 likes
        Last Post trilliantrader  
        Started by samish18, Today, 08:31 AM
        1 response
        1 view
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by Creamers, 09-08-2023, 10:26 AM
        6 responses
        157 views
        0 likes
        Last Post JonyGurt  
        Started by funk10101, Today, 08:14 AM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by bill2023, Yesterday, 08:51 AM
        3 responses
        22 views
        0 likes
        Last Post bltdavid  
        Working...
        X