• 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

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 ct, Today, 05:31 AM
      0 responses
      1 view
      0 likes
      Last Post ct
      by ct
       
      Started by ketotop7, Today, 03:58 AM
      0 responses
      5 views
      0 likes
      Last Post ketotop7  
      Started by Radiant0, Today, 03:55 AM
      0 responses
      4 views
      0 likes
      Last Post Radiant0  
      Started by pstrusi, Today, 02:21 AM
      0 responses
      5 views
      0 likes
      Last Post pstrusi
      by pstrusi
       
      Started by indy73, Yesterday, 10:52 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_EricB  
      Working...
      X