• 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

CrossOver not detected

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

    CrossOver not detected

    If a crossover occurs one way in a bar and then reverses and crosses the other way in the same bar, what test is true if checking OnBarUpdate for both conditions?
    Attached Files
    Last edited by sharpie; 08-12-2009, 05:48 PM.

    #2
    sharpie, which CalculateOnBarClose setting do you use in realtime trading? In backtesting it would always be evalutated on the Close of the bar, as the intrabar tick formation is not known.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I ran 2 parallel tests against reat time data. On one, CalculateOnBarClose was set to "true" and on the other "false". On the "false" one, nothing happened. On the case presented, it was set to "true".

      Comment


        #4
        sharpie,

        There is no test for both of these. If you want to know what happens intrabar you have to use CalculateOnBarClose = false. CrossAbove/Below conditions do not check current tick versus previous tick though. It checks last tick versus previous bar or whichever bar the lookback period is set to.

        You would need to keep track of the previous tick yourself to be able to check current tick versus last tick for crosses.
        JoshNinjaTrader Customer Service

        Comment


          #5
          Back to my original question. OnBarClose, I tested first for CrossBelow and exited any long position I may have had (I didn't have one). Then I tested for CrossAbove and triggered a buy. This morning I reversed the order of the two tests. On that basis, the CrossAbove should still trigger a buy, but the test for CrossBelow should also be positive (was the last crossover to occur) and cancel the long entry. Y/N?

          Comment


            #6
            No. CrossAbove/Below checks current bar versus previous bar. It does NOT check current tick vs previous tick. There is no way you can be true on cross above and below for the same bar.
            JoshNinjaTrader Customer Service

            Comment


              #7
              Many thanks. I'll look into testing on tick vs previous tick.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NinjaCustomer, Today, 12:14 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Marco  
              Started by U0000999, Yesterday, 11:49 PM
              0 responses
              4 views
              0 likes
              Last Post U0000999  
              Started by ahadari28, Yesterday, 04:01 PM
              0 responses
              5 views
              0 likes
              Last Post ahadari28  
              Started by TazoTodua, Yesterday, 06:00 AM
              2 responses
              19 views
              0 likes
              Last Post TazoTodua  
              Started by TazoTodua, Yesterday, 09:06 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X