Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CS0021 Error

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

    CS0021 Error

    Hi:

    I am getting a XS0021 error but from what I can tell from the help files, my code is correct. Can anyone shed some light?

    private double MyLow = LowestBar(Low,xBarsBack)[0];

    Thanks,
    C

    #2
    If this code is in a method such as OnBarUpdate() then you need to remove the "private"

    If its declared in the variables section then you can not yet call the LowestBar() method, you should call it in OnBarUpdate().
    RayNinjaTrader Customer Service

    Comment


      #3
      Some more info

      Hi:

      I am trying to see if the low of the current bar is lower than the lowest of the prior 120 bars excluding the current bar. Thus, I have:

      private double MyLow = (0); //Declared in Variables

      MyLow = LowestBar(Low,xBarsBack); //In OnBarUpdate()

      bool A = (Low[0] < MyLow[1]); //In OnBarUpdate()

      Any insight into how I can retrieve this value without getting the CS0021 error?

      Thanks,
      C
      Last edited by TapeReader; 03-29-2008, 10:04 AM.

      Comment


        #4
        Make sure this is in the OnBarUpdate method.
        See this tip - http://www.ninjatrader-support.com/v...ead.php?t=3170
        See this tip - http://www.ninjatrader-support.com/v...ead.php?t=3418

        This:

        private double MyLow = (0);

        likely needs to be:

        double MyLow = 0;
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        335 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X