Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT runs wrong version of the code

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

    NT runs wrong version of the code

    not hugely experienced programmer, have about 30 different strategies and indicators I have written for myself.
    but i am currently confused with the NT behaviour that i learned to expect for the last few years .
    please note, my question below is not about how to use visual studio, i simply use it to explain my confusion.

    have a strategy that uses a custom indicator. i use the built in editor all the time to code.
    I am trying to debug it using visual studio (i am using studio for 5 years in the same way, again, i am not asking help how to use it !)
    what I see in studio after i activate a strategy , it that the studio attached to the ninjatarder.exe process JUMPs to a "copy" of my code located in some user AppData/Local/Temp folder.
    However , when i read the code in that OTHER TEMP strategy, I see that it includes some code I have written some time ago. the version of my code is not the recent one i see in the NT8 editor.
    and of course the results of the run of the strategy are wrong.
    I reboot the whole PC and it doesn't help. same thing. it is as if the NT8 run some sort of other version of the code other than what i actually have in the editor.

    can you please explain what is happening ?

    for example, what does this mean: " the source file is different from when the module was built..."
    Click image for larger version

Name:	image.png
Views:	123
Size:	392.5 KB
ID:	1337154
    Last edited by dadarara; 03-09-2025, 02:47 AM.

    #2
    Hello dadarara,

    This error can appear with breakpoints in Visual Studio when attaching the debugger to the NinjaTrader process.

    During compilation, the open source code is compiled into NinjaTrader’s assembly source. The compiled copy of the code that runs within NinjaTrader coming from the internal source is different than the open source script you are editing which is kept separate and exposed as open source.

    To resolve, follow one of the options to disable these safety checks:
    • To modify a single breakpoint, hover over the breakpoint icon in the editor and select the settings (gear) icon. A peek window is added to the editor. At the top of the peek window, there's a hyperlink that indicates the location of the breakpoint. Select the hyperlink to allow modification of the breakpoint location and check Allow the source code to be different from the original.
    • To modify this setting for all breakpoints, go to Debug > Options and Settings. On the Debugging/General page, clear the Require source files that exactly match the original version option. Make sure to reenable this option when you're finished debugging.
    These instructions come from the Microsoft documentation on Troubleshooting Breakpoints in the Visual Studio Debugger:

    Microsoft documentation: Learn > Troubleshoot > Visual Studio > Troubleshoot breakpoints in the debugger
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    23 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    120 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X