Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.IsFirstBarOfSessionByIndex

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

    Bars.IsFirstBarOfSessionByIndex

    When using IsFirstBarOfSessionByIndex I wanted to look backward from where LastBarOfSession was found -to- where the session had started.

    I wrote into my script a loop using While and I incremented the index. My script did not find the FirstBarOfSession.

    int x = 1;
    while ( ! Bars.IsFirstBarOfSessionByIndex(x) ) x++;


    After I thought about it I guess it only makes sense that IsLastBarOfSessionByIndex would only work when my indicator looked from Left (older bars) to Right (newer bars). Not the other way around.

    I found many other ways to do my search.

    Minor issue. I just mention it because maybe it would be nice if the help file addressed this?
    Last edited by seefisch; 01-02-2016, 03:52 PM.

    #2
    Hello,

    Thank you for the question.

    I am not entirely sure what you were trying to do here, you said "When using IsFirstBarOfSessionByIndex I wanted to look backward from where LastBarOfSession was found -to- where the session had started. "

    Are you saying you wanted to find the Last session and get its start time? Could you provide more clarity on this?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      What I wanted to do was to find how many bars ago the session had started. From there I wanted to do a HighestBar(High, x) search to set the count to use for the HighestBar search.

      We used to have this in NT7 as BarsSinceSessionStarted, but now I need to do it myself.

      What I was doing was to set a counter and look backward, implementing my counter as I go, until I found the IsStartOfSession=true. It didn't work..

      I am a little more NT8 experienced now.:
      I used sessionIterator ActualStartTime
      Searched backward to find a bar with that Time Stamp
      I then found the difference in the BarsInProgress[0] of the two
      I then fed that result HighestBar(High,x) to get the Highest Bar of Session..
      Last edited by seefisch; 01-02-2016, 04:05 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by maybeimnotrader, Today, 05:46 PM
      0 responses
      5 views
      0 likes
      Last Post maybeimnotrader  
      Started by quantismo, Today, 05:13 PM
      0 responses
      6 views
      0 likes
      Last Post quantismo  
      Started by AttiM, 02-14-2024, 05:20 PM
      8 responses
      166 views
      0 likes
      Last Post jeronymite  
      Started by cre8able, Today, 04:22 PM
      0 responses
      8 views
      0 likes
      Last Post cre8able  
      Started by RichStudent, Today, 04:21 PM
      0 responses
      5 views
      0 likes
      Last Post RichStudent  
      Working...
      X