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 SalmaTrader, 07-07-2026, 10:26 PM
          0 responses
          36 views
          0 likes
          Last Post SalmaTrader  
          Started by CarlTrading, 07-05-2026, 01:16 PM
          0 responses
          20 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 06-17-2026, 10:32 AM
          0 responses
          14 views
          0 likes
          Last Post CaptainJack  
          Started by kinfxhk, 06-17-2026, 04:15 AM
          0 responses
          19 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 06-17-2026, 04:06 AM
          0 responses
          22 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Working...
          X