Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 RaddiFX, Yesterday, 09:55 PM
          4 responses
          29 views
          0 likes
          Last Post RaddiFX
          by RaddiFX
           
          Started by geotrades1, Today, 08:33 AM
          5 responses
          16 views
          0 likes
          Last Post geotrades1  
          Started by Entwaze, 02-19-2024, 07:13 PM
          2 responses
          68 views
          0 likes
          Last Post MalachiHatfield  
          Started by tkaboris, Today, 08:32 AM
          5 responses
          13 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by f.saeidi, Today, 07:07 AM
          3 responses
          9 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X