Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CrossAbove()

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

    CrossAbove()

    Hi,

    Even Though I use the funtion CrossAbove() & CrossBelow(), sometimes gets true just when touching the specified level, and some other times becomes true when the level is crossed, (as expected).

    How can be that sometimes the Cross functions acts when the level has only be touched?

    Thanks

    #2
    Hi CJS, in which code context are you using those methods?

    Comment


      #3
      In the unmanaged approach.

      Comment


        #4
        CJS, ok do you have a code snippet of which scenario you're trying to evaluate?

        Comment


          #5
          Something like this:

          if (CrossAbove(High,upper+(TickSize*(RiskLevel)),1))
          {
          contadorNeutral=
          0; // counter
          CruceAlcista=
          false; // bool variable
          CruceBajista=
          true; // bool variable
          contador=
          0; // another counter


          if (SrtOrder1 != null)
          {
          CancelOrder(SrtOrder1);
          }
          }

          Any clue?

          Thanks

          Comment


            #6
            CJS, I looked into and your findings are accurate, it can also return 'true' on a touch in those scenarios. You can add a custom check here to include an offset for example to trigger your condition.

            Comment


              #7
              ok,

              I' ll do that.

              Thanks.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CaptainJack, 05-29-2026, 05:09 AM
              0 responses
              305 views
              0 likes
              Last Post CaptainJack  
              Started by CaptainJack, 05-29-2026, 12:02 AM
              0 responses
              198 views
              0 likes
              Last Post CaptainJack  
              Started by charlesugo_1, 05-26-2026, 05:03 PM
              0 responses
              186 views
              1 like
              Last Post charlesugo_1  
              Started by DannyP96, 05-18-2026, 02:38 PM
              1 response
              274 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 05-11-2026, 05:56 AM
              0 responses
              228 views
              0 likes
              Last Post CarlTrading  
              Working...
              X