Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader.Vendor.cs automatically removed from NinjaTrader.Custom.csproj

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

    NinjaTrader.Vendor.cs automatically removed from NinjaTrader.Custom.csproj

    Hi there,

    I'm developing a custom NT8 indicator that references the OrderFlowCumulativeDelta indicator. I'm using NinjaScript Editor and Visual Studio 2019 as my development environments.

    Scenario:
    When using only NinjaScript Editor, my indicator compiles correctly (without errors) however using Visual Studio my indicator only compiles if I manually include the file NinjaTrader.Vendor.cs within the NinjaTrader Custom project (NinjaTrader.Custom.csproj).

    Issue:
    After successfully compiling my indicator in Visual Studio, if I close NinjaTrader and Visual Studio programs and then reload NinjaTrader, NinjaTrader automatically removes the reference to NinjaTrader.Vendor.cs from the NinjaTrader Custom project which then leads to Visual Studio not compiling my indicator.

    Question:
    How can I prevent NinjaTrader from automatically excluding NinjaTrader.Vendor.cs from the NinjaTrader Custom project?

    Thanks,
    -Cary

    #2
    Hello Cary,

    Are you making changes to the script in Visual Studio and then saving the script to trigger the auto-compile in the NinjaScript Editor?

    Do not compile NinjaTrader from Visual Studio.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi there,

      I make changes in both NinjaTrader and Visual Studio and aside from the previously referenced issue with NinjaTrader.Vendor.cs I have no issues with compilation in either development environment. Typically, if I'm making changes to user defined input properties I'll start with NinjaTrader since it auto-generates related caching code however for non-property logic I'll usually use Visual Studio primarily because I have several external projects where my core logic is stored. As a side note, typically Visual Studio's compilation triggers NinjaTrader to recompile (it's Custom project) however if that doesn't automatically occur I simply manually recompile within NinjaTrader and then both environments become synchronized. The issue I'm having does not directly relate to general compilation nor sync'ing between my two development environments. Instead, the issue relates to permanent inclusion of NinjaTrader.Vendor.cs within NinjaTrader.Custom.csproj as required to use programmatically use the OrderFlowCumulativeDelta indicator.

      Following the guidance in thread "using OrderFlowCumulativeDelta programmatically?" (https://ninjatrader.com/support/foru...ogrammatically) temporarily resolves my issue, as-in right-clicking in Visual Studio and including the file NinjaTrader.Vendor.cs within the Custom project (NinjaTrader.Custom.csproj) then enables Visual Studio (and NinjaTrader) to successfully compile and I can then use OrderFlowCumulativeDelta programmatically. After NinjaTrader.Vendor.cs is included within the Custom project I can see a reference to it in the NinjaTrader.Custom.csproj file however after closing both NinjaTrader and Visual Studio and then reloading just NinjaTrader the include line for NinjaTrader.Vendor.cs is automatically removed from the NinjaTrader.Custom.csproj file. My question is essentially then how can I permanently maintain the include line for NinjaTrader.Vendor.cs within NinjaTrader.Custom.csproj? The challenge appears to be that although there's a reference to NinjaTrader.Vendor.dll within NinjaTrader.Custom.csproj I'm unable to include the file NinjaTrader.Vendor.cs using just NinjaTrader (instead need to use Visual Studio).

      Thanks,
      -Cary

      Comment


        #4
        Hello caryc123,

        Clicking the VisualStudio button from the NinjaScript Editor should include everything needed to access all namespaces available to NinjaScript.

        Do not compile in VisualStudio. Leave the NinjaScript Editor open and then save the script in VisualStudio and this will trigger NinjaTrader to automatically compile (when it detects changes to scripts modified outside of NinjaTrader).

        From my understanding including the NinaTrader.Vendor.cs is so the intelliview works when calling the OrderFlowCumulativeDelta.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi there,

          My apologies, in my previous post I meant to convey saving a file in Visual Studio that is being monitored by NinjaTrader automatically causes NinjaTrader to compile, so we're in sync on that. As for not compiling in Visual Studio, for large/complex projects compiling in Visual Studio is beneficial and has successfully been part of my development process for almost a year now. I understand if my issue relates to an unsupported usage workflow and if so just let me know. If you're still able to help, below are repro steps that may help shed more light on my issue.

          Repro steps:
          1) Confirm existence of NinjaTrader.Vendor.cs and NinjaTrader.Vendor.dll (NinjaTrader 8\bin\Custom folder)
          2) Launch NinjaTrader
          3) Launch Visual Studio from NinjaTrader and notice NinjaTrader.Vendor.cs is not marked as included
          4) Exit Visual Studio
          5) Install an indicator that depends on NinjaTrader.Vendor.dll (e.g. Delta Momentum or RMO as linked below)
          6) Notice NinjaTrader silently successfully compiles
          7) Exit NinjaTrader
          At this point all is good from NinjaTrader's perspective, however due to the size and complexity of my code base I want to continue working near-exclusively in Visual Studio, making changes to NinjaTrader's Custom project and compiling in Visual Studio, as I've done successfully for many months. I understand some changes must first be made in NinjaTrader (e.g. implementing new user defined input properties). The only reason Visual Studio doesn't compile is because the NinjaTrader.Vendor.cs file is not marked as included.
          8) Launch Visual Studio
          9) Initiate "Build NinjaTrader.Custom" action and notice the error "Non-invocable member 'OrderFlowCumulativeDelta' cannot be used like a method".
          10) Right-click NinjaTrader.Vendor.cs and select "Include in Project"
          11) Initiate "Build NinjaTrader.Custom" action and notice the project builds successfully
          At this point all is good from Visual Studio's perspective
          12) Exit Visual Studio
          13) Launch NinjaTrader
          14) Launch Visual Studio from NinjaTrader and notice NinjaTrader.Vendor.cs is no longer marked as included (which then will cause Visual Studio not to compile successfully)

          My issue is that the inclusion of NinjaTrader.Vendor.cs is not being preserved upon launching of NinjaTrader. Perhaps NinjaTrader has special logic for NinjaTrader.Vendor.cs? Thus, my question is: Do you know how I can permanently prevent NinjaTrader from removing NinjaTrader.Vendor.cs as an included file in the NinjaTrader.Custom project?

          Indicator sources:
          - Delta Momentum (irDeltaMomentumV2) found at https://futures.io/local_links.php?a...27&linkid=2079
          - Rahul Mohindar Oscillator (RMO) found at https://ninjatraderecosystem.com/use...ar-oscillator/

          Thanks,
          -Cary

          Comment


            #6
            Hello Cary,

            I am submitting your vote to feature request SFT-3889 'Include NinjaTrader.Vendor.cs with Visual Studio Project'.

            However, this is not officially supported at this time.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Okay, and thank you.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              657 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              373 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              579 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X