• 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

Bar after bool is true

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

    Bar after bool is true

    Hi All,

    How do I reference a bar which immediately follows a bar where a bool is true. That is, if during current bar, the bool becomes true, I would like to refer to the bar following that bar and by referring, I mean access the open, high, low and close of that bar.

    Regards

    Kay Wai

    #2
    Hello Kay,

    Thank you for your post.

    You can use FirstTickOfBar and the Bool together to get the next bar has been created and then you can access those values.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal,

      Thank you for your quick reply.
      1) FirstTickOfBar is genrally used where cobc = false, right?
      2) if i want, for example, to compare the high of the bar following the bar where the bool became true to the high of the bool bar or to the high of the bar before the bool, and this comparison can only be made if the bool bar is true, how would i go about doing that?

      Perhaps i'm overthinking this but it feels complicated to me. Ideally if there was a High[-1] or something to that effect, maybe that would make it a lot easier though i'm not too sure either.

      Regards
      Kay Wai

      Comment


        #4
        Kay,

        Correct, this is generally used with COBC set to false.

        I think I see the purpose what you are trying to achieve.

        While this would be plausible in a back test with historical data, it would not work in a live situation as there is no -1 bar index in this case.

        Is this bool mean't to be become true in a live situation?
        Or are you looking at this historically?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Hi Cal,

          This bool is meant to become true in a live situation. The following bar must then meet certain criteria before an entry can be made.

          Regards

          Kay Wai

          Comment


            #6
            Kay,

            Then the FirstTickOfBar will be what you are looking for. We would run this for COBC = false, so that when your bool becomes true we are still waiting for the next bar to start, which is where FirstTickOfBar comes in handy.

            Let me know if I can be of further assistance.
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bosajin, Yesterday, 06:27 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jim  
            Started by stefanrvc, Today, 04:59 AM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_Marco  
            Started by 7robert, Yesterday, 08:30 PM
            2 responses
            16 views
            0 likes
            Last Post NinjaTrader_Marco  
            Started by pjsmith, Today, 01:13 AM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_ChrisSch  
            Started by yukashg, Yesterday, 09:56 PM
            1 response
            16 views
            0 likes
            Last Post NinjaTrader_ChrisSch  
            Working...
            X