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

The Breakpoint will not currently be hit source code is different...

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

    The Breakpoint will not currently be hit source code is different...

    This is the message i get in VSCODE debugging... debugging is working because it can catch exceptions but not the breakpoints...

    #2
    One solution is to use https://stackoverflow.com/a/8783865

    Comment


      #3
      Hello bukowa,

      Thank you for your post.

      Unfortunately, VSCode is not supported (as it targets .NET Code and not .NET Framework).

      We suggest using VS Community edition, and allowing source files to be different than compiled project.



      To allow source files to be different than compiled project:
      • 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

      Please let me know if you have any other questions.​
      Gaby V.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_Gaby View Post
        Hello bukowa,

        Thank you for your post.

        Unfortunately, VSCode is not supported (as it targets .NET Code and not .NET Framework).

        We suggest using VS Community edition, and allowing source files to be different than compiled project.



        To allow source files to be different than compiled project:
        • 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

        Please let me know if you have any other questions.​
        I am very sorry, of course I mean Visual Studio Whoever thought that naming these two editors like that is a good idea never did googling in the life!

        Thanks

        Comment


          #5
          I'm also getting this (Visual Studio) after updating to latest version 8.1.2. Never had any issues before upgrading from 8.0.28. Tried changing the setting but it's not working.

          Edit: It does not work with Unirenko bars or any other non-minute based bars at all. When switching to minute bars I get a dialog saying the source file is different from when the module was built and then asking if I still want to use it. Then I get into debug mode in VS. However I need to debug using Unirenko bars...
          Last edited by Borgen; 11-13-2023, 04:47 AM.

          Comment


            #6
            Originally posted by Borgen View Post
            I'm also getting this (Visual Studio) after updating to latest version 8.1.2. Never had any issues before upgrading from 8.0.28. Tried changing the setting but it's not working.

            Edit: It does not work with Unirenko bars or any other non-minute based bars at all. When switching to minute bars I get a dialog saying the source file is different from when the module was built and then asking if I still want to use it. Then I get into debug mode in VS. However I need to debug using Unirenko bars...
            Make sure you right click > debug mode in NinjaScript Editor. I remember i couldn't get it work with fresh installation but i also don't remember exact steps (trial and error)

            Comment


              #7
              Yeah it's not that, I always have debug mode on by default since I work on code.
              I'm using an added timeseries to a unirenko chart to project lines based on minute based charts. Whenever I use the indicator to a time based chart, it works, no matter the time.
              Drop it on a renko, unirenko, ninzarenko, heikenashi or any other non minute based chart and the script doesn't seem to even run after State.Configure.

              Comment


                #8
                Hello Borgen,



                To allow source files to be different than compiled project:
                • 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



                Please let me know if I can assist further.
                Gaby V.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Gaby View Post
                  Hello Borgen,



                  To allow source files to be different than compiled project:
                  • 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



                  Please let me know if I can assist further.
                  Did you seriously just copy/paste your answer from post 3?
                  If you had actually read my statement in post 5 you would have known that I DID try that setting and it did not work. I later added that it did work, but only on minute based charts and not time independent charts such as renko , unirenko etc.​

                  Comment


                    #10
                    Hello Borgen,

                    "I get a dialog saying the source file is different from when the module was built and then asking if I still want to use it."

                    The documented way to resolve this is to follow the instructions provided. This is from the Microsoft documentation, linked below:

                    https://learn.microsoft.com/en-us/tr...ion-built-into

                    Please let me know if you have any other questions.
                    Gaby V.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Gaby View Post
                      Hello Borgen,

                      "I get a dialog saying the source file is different from when the module was built and then asking if I still want to use it."

                      The documented way to resolve this is to follow the instructions provided. This is from the Microsoft documentation, linked below:

                      https://learn.microsoft.com/en-us/tr...ion-built-into

                      Please let me know if you have any other questions.
                      Gaby,

                      Why bother answering if you.re not going to read the full posts. What is the problem I am describing? I write that debugging works with TIME based charts, but not time independent charts...

                      Just forget it. Ninjatrader is known to be buggy with any time independent bartype that isn't based on minutes. It's not like your developers have done anything to fix it during the past 2-3 years.
                      I'm not going to get any help resolving it from this forum to be hones so lets just drop it

                      Comment


                        #12
                        Hello Borgen,

                        Please provide a screenshot to confirm this setting is turned on in Tools > Options.

                        I look forward to assisting.
                        Gaby V.NinjaTrader Customer Service

                        Comment


                          #13
                          Click image for larger version

Name:	image.png
Views:	259
Size:	105.2 KB
ID:	1277701

                          Click image for larger version

Name:	image.png
Views:	268
Size:	14.7 KB
ID:	1277702
                          Does this do? It's not the setting.

                          Comment


                            #14
                            You can try this simple example code on a minute (any will do) chart and see it work. Then do any type of non time based chart, renko, unirenko, ninzarenko, heiken ashi...it won't draw the line.

                            Code:
                                public class TestRenko : Indicator
                                {
                                    private double firstBar;
                                    private DateTime beginTime, endTime;
                            
                                    protected override void OnStateChange()
                                    {
                                        if (State == State.SetDefaults)
                                        {
                                            Description                                    = @"";
                                            Name                                        = "TestRenko";
                                            Calculate                                    = Calculate.OnBarClose;
                                            IsOverlay                                    = true;
                                            DisplayInDataBox                            = true;
                                            DrawOnPricePanel                            = false;
                                            DrawHorizontalGridLines                        = true;
                                            DrawVerticalGridLines                        = true;
                                            PaintPriceMarkers                            = true;
                                            ScaleJustification                            = NinjaTrader.Gui.Chart.ScaleJustification.Right;
                                            Lookback = 5;
                                            //Disable this property if your indicator requires custom values that cumulate with each new market data event.
                                            //See Help Guide for additional information.
                                            IsSuspendedWhileInactive                    = true;
                                        }
                                        else if (State == State.Configure)
                                        {
                                            AddDataSeries(Data.BarsPeriodType.Day, 1);
                                        }
                                    }
                            
                                    protected override void OnBarUpdate()
                                    {
                                        if(CurrentBars[0] < Lookback || CurrentBars[1] < Lookback) return;
                            
                            
                                        if(BarsInProgress == 0)
                                        {
                                            if (Bars.IsFirstBarOfSession)
                                            {
                                                firstBar = Open[0];
                                            }
                            
                                            beginTime = Times[1][0];
                                            endTime = Time[0];
                                            Draw.Line(this, "Daily Open", false, beginTime, firstBar, endTime, firstBar, Brushes.Orange, DashStyleHelper.Dash, 5);
                                        }
                                        else if (BarsInProgress == 1)
                                        {
                            
                                        }
                                    }
                            
                                    [NinjaScriptProperty]
                                    [Range(1, int.MaxValue)]
                                    [Display(Name="Lookback", Order=1, GroupName= "Settings")]
                                    public int Lookback
                                    { get; set; }
                                }​

                            Comment


                              #15
                              Hello Borgen,

                              Thank you for your response.

                              Please send us an email at scriptingsupport [at] ninjatrader.com so we can look into this further with you. In the body of the email, please include a link to this forum thread.

                              Thank you in advance. ​
                              Gaby V.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by fx.practic, 10-15-2013, 12:53 AM
                              5 responses
                              5,404 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by Shai Samuel, 07-02-2022, 02:46 PM
                              4 responses
                              95 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by DJ888, Yesterday, 10:57 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by MacDad, 02-25-2024, 11:48 PM
                              7 responses
                              160 views
                              0 likes
                              Last Post loganjarosz123  
                              Started by Belfortbucks, Yesterday, 09:29 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post Belfortbucks  
                              Working...
                              X