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

Visual Studio type conflict warnings

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

    Visual Studio type conflict warnings

    I have been cleaning up my code, keeping VS/Roslyn happy... but I still have a swag of these bizarre warnings (see attached) that have me stumped.

    All I do in my indicators is fairly vanilla stuff (I think) eg declaring a variable of type SMA... calling some of the drawing methods, but VS throws these warnings up.
    FYI, I have NO other complaints from VS... everything else in my code is 100% kosher. I do create a couple VERY simple classes, all works fine...

    But these errors are also shown for example on the Sample SMA CrossOver strategy ... which is surely all good. Seems to suggest to me something deeper is out of kilter ??

    Any ideas what might be causing it?

    VS Warnings.txt

    Regards,

    #2
    Hello tgn55, thanks for your post.

    Warnings are suppressed by default in the NinjaScript editor. Warnings can be enabled via the NS editor properties. They are inert warnings so they can be ignored.

    Best regards.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi tgn55,

      If you still have issues with this, let me know and I will post how to get rid of all warnings.

      Wil

      Comment


        #4
        Hey Wil, yes I still have these warnings in VS... any suggestions on how to eliminate them welcome!

        Thanks,
        T.

        Comment


          #5
          Hi tgn55,

          I posted my solution at

          Comment


            #6
            Thanks Wil... interesting.

            I think in my case your solution won;t work... as I use VS a lot for debugging code, not just as a nicer editor. For that, it needs to attach to the NT process, I guess you are familiar with the setup.

            I'd be glad to get rid of the dopey warnings... but NOT if it means I can no longer use VS for debugging... which is pretty crucial for my work. Can you comment on that?

            BTW... it seems to me that NT is built using a really old version of C#... is that correct? I found some more recent C# syntax is not accepted. Sorry... probably belongs in a different thread.

            Cheers,
            T.

            Comment


              #7
              Hi tgn55,

              With my current setup, I am using .NET 4.7.2 to compile so I have all the latest features. I can still attach for debugging! As a matter of fact, I do it all the time. When I don't need to debug, I use VS Code (I haven't figured out how to attach from that yet ).

              The only downside (I've seen) to using a newer compiler is that the NT Script Editor will flag all the new syntax as warnings - it will still compile correctly though. This isn't an issue for me as I use either VS or VS Code to edit. I only use the NT Script Editor to turn on/off debug mode.

              TIPS
              • If you are not using it yet, I highly recommend the "Reattach" addon for VS. After you attach once, you only need to click the Reattach button to attach in the future. No more searching for the NT process!!!
              • If you want to use the newer C# syntax, see my post Hack Alert: Compile with .net 4.6!. As stated above, I use .NET 4.7.2 so I get all the new C# syntax. I haven't tried out nullable reference types yet though.

              Thanks,
              Wil

              Comment


                #8
                Thanks again... I am flat out debugging strategies at present... so have not really had time to mess with your setup. Re the Reattach thing... it's already there in my VS, I am running VS Pro 2019, and yes I use it heaps ;-)

                When I (??) make some money running this strategy... I'll come back and play with this stuff.

                Cheers,
                T.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by inanazsocial, Today, 01:15 AM
                0 responses
                2 views
                0 likes
                Last Post inanazsocial  
                Started by trilliantrader, 04-18-2024, 08:16 AM
                5 responses
                22 views
                0 likes
                Last Post trilliantrader  
                Started by Davidtowleii, Today, 12:15 AM
                0 responses
                3 views
                0 likes
                Last Post Davidtowleii  
                Started by guillembm, Yesterday, 11:25 AM
                2 responses
                9 views
                0 likes
                Last Post guillembm  
                Started by junkone, 04-21-2024, 07:17 AM
                9 responses
                70 views
                0 likes
                Last Post jeronymite  
                Working...
                X