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 kawalecld, Today, 12:21 PM
      0 responses
      5 views
      0 likes
      Last Post kawalecld  
      Started by exjayess, Today, 11:04 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Started by robertlaub, Today, 11:11 AM
      2 responses
      6 views
      0 likes
      Last Post robertlaub  
      Started by sdauteuil, Today, 10:28 AM
      0 responses
      6 views
      0 likes
      Last Post sdauteuil  
      Started by KirkHammett, Today, 08:11 AM
      0 responses
      7 views
      0 likes
      Last Post KirkHammett  
      Working...
      X