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 cincai, Today, 07:02 PM
        0 responses
        1 view
        0 likes
        Last Post cincai
        by cincai
         
        Started by AlexsOptions, Today, 05:42 PM
        2 responses
        12 views
        0 likes
        Last Post AlexsOptions  
        Started by philli4093, Today, 05:20 PM
        2 responses
        8 views
        0 likes
        Last Post philli4093  
        Started by memonolog, Today, 04:58 PM
        0 responses
        4 views
        0 likes
        Last Post memonolog  
        Started by robvul, Today, 04:20 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Working...
        X