Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buggy compile

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

    Buggy compile

    Experiencing strange compile behavior. Simple logic like a boolean if statement is failing (Ie the value is true but it doesn't go thru, etc - print statements prove it's true). Then it works. Then something else fails. I've been making a TON of changes to a script and I'm thinking the compiled file needs to be wiped and compile clean. In one case, I manually did this by deleting the strategy then copying the script back verbatim in sections and recompiling. That's why I have a strong feeling it's not a logic problem because all I did was a straight copy paste.

    I've heard rumors that the following is one way to clean compiled code. Please advise if you support this approach or recommend a more appropriate alternative.
    1. Close Ninja Trader
    2. Delete NinjaTrader Cache and Temporary Files:
    1. Navigate to the Documents\NinjaTrader 8 folder.
    2. Delete the cache folder and any other temporary files that may be there (like log, trace, etc.). This will not delete your strategies or indicators but will remove any cached data that might be causing issues.
    3. Delete the Custom.dll File:
    1. Navigate to Documents\NinjaTrader 8\bin\Custom.
    2. Locate the NinjaTrader.Custom.dll file.
    3. Delete this file. This is the compiled assembly for all custom NinjaScript files.
    4. Restart NinjaTrader:
    1. Open NinjaTrader again. When it starts, it will detect the absence of the compiled assembly and will recompile all the NinjaScript files.
    5. Recompile NinjaScript:
    1. Go back to the NinjaScript Editor.
    2. Open any script and compile it again by clicking the Compile button or pressing F5.
    Thoughts?

    #2
    Hello cshox,

    It would not be expected for you to manually manage files in the custom folder so that process would not be suggested. Do you see this happening if you do certain steps in a clean install and do not manually manage any files? If so can you provide a .cs file as a sample that shows what code was tested, the steps used to see the problem and a specific description of what was wrong?

    There are cases where editing a script will require re applying the script in case you are doing an F5 and not seeing the expected result. Making any class level changes or changes to OnStateChange would require re applying the script instead of using reload NinjaScript.

    Comment


      #3
      I'm going to chalk previous issue up to a poltergeist unless it happens again. Thanks for the guidance there.

      As to "re-applying" the script versus "reload". Can you please clarify what you mean. In the editor I constantly compile changes. In a chart I assign the strategy and enable / disable it. Not sure if you're just talking about synonyms of these same processes or if these are additionally steps.

      Comment


        #4
        Hello cshox,

        The reasons you may need to reload or re apply are the reasons I had mentioned: Making any class level changes or changes to OnStateChange would require re applying the script instead of using reload NinjaScript. Changes to OnBarUpdate you can use F5.

        Re applying means to completely remove the strategy from the chart and re apply it.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        51 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        127 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X