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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X