Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

what is wrong with this syntax

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

    what is wrong with this syntax

    int noOfBarsBelowM50=CountIf(delegate{return CCI(14)<-5;},CurrentBar-RecentCCI200CrossAbove);

    RecentCCI200CrossAbove is declared as integer.

    i get compile error @

    i am trying to count the number of instances the CCI(14) went below -50 in the past from the point CCI(14) crossed above 200.

    #2
    junkone,

    Try this one:

    int noOfBarsBelowM50=CountIf(delegate{return CCI(14)[0]<-50;},CurrentBar-RecentCCI200CrossAbove);

    Comment


      #3
      hmmm. thanks. just wondering if i use cci(14)[0], would it not just look at the current bar.
      just trying to learn here.

      Comment


        #4
        Yes, it will start from the current bar and will go back up to the lookbackperiod you have defined

        Comment


          #5

          What int is RecentCCI200CrossAbove? Must be a Bar numbe. The result of the this substraction must be bars 10, 100 ... This is the lookbackperiod.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          160 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          307 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          244 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          348 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          178 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X