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

indicator fails to compile with code 'CS103 - variable not declared'

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

    indicator fails to compile with code 'CS103 - variable not declared'

    the attached indicator fails to compile with error 'the name 'PlotHAO' does not exist in the current context' and code 'CS103 - variable not declared'. I have unsuccessfully spent hours trying in various ways to research and fix the error. backups I made within NT failed to work with an error something like 'restoration would corrupt the system'. Any help will be much appreciated. the file for the indicator code is attached. the offending line of code at line 47 is "
    PlotHAO.Set(((PlotHAO[
    1]+joeHACindicator3(1)[1])/2));"joeHAOindicator.cs

    #2
    Problem resolved by myself

    I failed to notice in the error message that the error was occurring in a different indicator than the indicator being compiled. That is, the code in another newly created indicator that is almost identical in name and code to the one being compiled was the indicator with the problem. everything works ok now that I have gone to the new indicator and fixed the problem there.

    Comment


      #3
      Originally posted by joemiller View Post
      I failed to notice in the error message that the error was occurring in a different indicator than the indicator being compiled. That is, the code in another newly created indicator that is almost identical in name and code to the one being compiled was the indicator with the problem. everything works ok now that I have gone to the new indicator and fixed the problem there.
      Yep - all code must compile in <=NT7...

      From what I saw in NT8 pre-video - this will NOT be case (UNLESS of course, the code depends on the bad code, independent scripts that fail to compile won't matter)...

      Comment


        #4
        I like the feature, now that I am aware of it.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        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  
        Started by GLFX005, Today, 03:23 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X