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

Referencing DLL in NT7 custom indicator

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

    Referencing DLL in NT7 custom indicator

    VS 2015 express, C#, and DLL's are a new world to me, despite being a developer in other languages ! I have created my first DLL (trivial - add two numbers) which works fine when called from a standalone C# exe.
    After placing this DLL in NT7's bin/custom directory, and adding a reference to the DLL, in an existing (working) indicator I get these messages !

    NT 64-bit 7.0.1000.30

    Output Window
    Error on calling 'OnBarUpdate' method for indicator 'TestMA' on bar 0: Could not load file or assembly 'MyFirstDLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    Trace
    2015-12-29 07:17:24:448 Loading 3rd party C:\Users\oem\Documents\NinjaTrader 7\bin\Custom\MyFirstDLL.dll...
    2015-12-29 07:17:24:455 WARNING: Ignoring 'C:\Users\oem\Documents\NinjaTrader 7\bin\Custom\MyFirstDLL.dll' since it was not recognized as .NET assembly.

    I note that other indicators generally deliver three files - .cs, .dll (32bit), .dll (64bit).
    How do I do this in VS2015 please ? Note : In VS I have set output to 64bit, and dot.net at version 3.5 for generated output, thinking that this is the latest compatible for NT7.
    I have googled and read just about every relevant forum post I can find and am still stumped as I just dont know enough about generating assemblies for NT from VS. I would be grateful for any assistance please.
    Attached Files
    Last edited by Standing wave 2; 12-28-2015, 03:23 PM.

    #2
    Hello,

    Thank you for the question.

    Based on your information it seems you should have everything set up:
    for NT7: .net 3.5
    for NT8 up to 4.5

    If you are using the 64bit icon for NT, and you said you have compiled the dll as 64 bit that should be correct as well. Please note you could also use ANYCPU in most cases as well, depending on the use case.

    Also the x64 x32 and .dll generated for standard NT assemblies, this is all done by NT and would not occur with VS so that is expected.

    In your case, it may be if you have not yet restarted NT yet? the assembly may have not yet been loaded but just referenced, can you confirm have you restarted the platform?

    If that is not the case, if this is a simple project you could zip the contents of your solution and upload it so I could see what is being used that is not working.

    In the case you have other references from prior tests still listed in the project references, it could be possible that you have indicated to require X.dll but that X.dll is not present in the bin/custom folder with your custom dll.


    Edit: I see you posted the file while I posted my response, please check the above and let me know if that was the case, if not I will review the project and see what is occurring.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse, thank you for your prompt reply.
      In answer your suggestions,
      I have tried both 64bit and ANYCPU settings, I have restarted NT and rebooted PC several times during this testing, and the indicator which references this DLL does not use any other references, indeed it is just a 'skeleton'. Its still a mystery to me ?

      Comment


        #4
        Hello,

        Thank you for trying that,

        because I can not see what you have referenced in your existing solution file, its hard to say what is happening.

        Instead I composed a short video and will upload a bare bones example. I believe you are likely running into either 1. using a old incorrect versions I.E. once built as 32 and used in 64, or 2. you have a reference in the solution which is not in NinjaTrader so there is a conflict.

        Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


        I look forward to being of further assistance.
        Attached Files
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks very much Jesse,
          The video is just what I needed.
          I also picked up a few tips in it, that Iwouldn't have found easily.
          Cheers

          Comment


            #6
            Can you please post the above video again in mp4 format or any site, that doesnt require flash player?

            Comment


              #7
              Hi ttouda,

              I re-recorded the video in TinyTake here:
              Chris L.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Rapine Heihei, Today, 08:19 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Rapine Heihei, Today, 08:25 PM
              0 responses
              6 views
              0 likes
              Last Post Rapine Heihei  
              Started by f.saeidi, Today, 08:01 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Rapine Heihei, Today, 07:51 PM
              0 responses
              8 views
              0 likes
              Last Post Rapine Heihei  
              Started by frslvr, 04-11-2024, 07:26 AM
              5 responses
              98 views
              1 like
              Last Post caryc123  
              Working...
              X