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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          155 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          90 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          137 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          130 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          107 views
          0 likes
          Last Post CarlTrading  
          Working...
          X