Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Crossover/below tiggers when values are equal

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

    Crossover/below tiggers when values are equal

    I can't seem to stop the crossover function to stop triggering when the values are equal and not a true cross. Is that built-in to the Crossover logic? I tried adding conditions (in wizard) that required "value1 > value2" and also tried adding "value1 != value2"

    Also, I am basing this on backtest results and value readings of MAs on the data window.

    Thanks.

    #2
    Hello Billr,

    CrossAbove and Below should require that the value penetrates another.

    Share with us a snippet you're using and how you are testing this so we can see what might be happening in your case.

    One thing to check is the lookBackPeriod. Are you setting this to 1 or looking at cross values farther back?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Click image for larger version

Name:	Crossover problem.JPG
Views:	1
Size:	71.4 KB
ID:	857708

      Attached is a snippet of a sample problem. It is hard to see, but an MA cross is triggered when values are equal. In this example, the settings are as follows:

      GBP/JPY renko30
      DEMA13 and DEMA14 (many other settings experience same problem)
      I am using the Data Box to determine that the values are equal and not crossed under the assumption it is accurate. Each of the trade triggers you see on the snippet are triggers when values are equal and NOT crossed. (note: you will notice an unusual trade price due to a special Renko fill type that I am using to adddress the renko reversal bar fill problem in backtesting).

      Thanks.

      Comment


        #4
        Regarding my last post, I noticed that the cursor moved the values in the data box to the wrong bar. But if the cursor was placed on the triggering bar, the values would also be equal. I should also note that the problem occurs when using the default fill type.
        I am using NT7.17.
        Thanks.

        Comment


          #5
          billr, is it possible the values you're viewing in the data window are rounded to two decimal places? What happens if you Print() the values here and view through output window?
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Yes Ryan, the Data Box only shows 2 decimals. Can I change that? Also, I don't know how to print() to the Output window. Sorry.

            thanks.

            Comment


              #7
              Hi billr,

              Unfortunately, there's no way to increase the number of decimal points on display here.

              To print the values, enclose the following statements in the same block that executes your orders.

              Print("DEMA 13: " + DEMA(13)[0]);
              Print("DEMA 14: " + DEMA(14)[0]);

              Then, view the output through Tools > Output window.
              Ryan M.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              589 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              342 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              555 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              552 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X