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

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 samish18, Yesterday, 08:31 AM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by funk10101, Yesterday, 09:43 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        5 responses
        551 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by rtwave, 04-12-2024, 09:30 AM
        5 responses
        37 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by funk10101, Today, 12:02 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X