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, 09: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 tgn55, Today, 09:51 PM
        0 responses
        1 view
        0 likes
        Last Post tgn55
        by tgn55
         
        Started by cxxazssx, Today, 09:45 PM
        0 responses
        1 view
        0 likes
        Last Post cxxazssx  
        Started by southpacific001, 02-26-2021, 09:25 PM
        14 responses
        64 views
        0 likes
        Last Post REI140205  
        Started by punkiy2111, Today, 05:22 PM
        0 responses
        3 views
        0 likes
        Last Post punkiy2111  
        Started by secrettrader, Today, 03:36 PM
        0 responses
        8 views
        0 likes
        Last Post secrettrader  
        Working...
        X