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

Self-made library protected compiled assemblies error

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

    Self-made library protected compiled assemblies error

    Hello.

    I made my own NinjaScript library:


    Code:
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Gui.Chart;
    
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    
    namespace i_Lib
    {
        public enum CS { Black, White, Print }; //ColorSet
        public enum TF { H1, D1, W1 }
        public struct BandColors_struct
        {
            public Color fill_color;    
            public Color plots_color;
        }
    }
    I put this code to i_Lib.cs file and saved it to NinjaTrader 7\bin\Custom\Indicator\ folder.

    And I use this library in my different idicators this way:
    Code:
    using i_Lib;
    It work good on my computer.

    Now I need to export some of my indicators, that using this library in protected compiled assembly.

    I can made assembly in my computer.
    But I got error when import assembly on another computer.

    What am I doing wrong?
    Please help.
    Attached Files
    Last edited by fx.practic; 03-12-2015, 01:48 PM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Fx.Practic,

    I tested your code out on my end and was able to export and import into a blank NinjaTrader.

    Are there any other assemblies in your Custom folder?

    Can you try manually importing the .dll, add the reference to the editor and compile?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Fx.Practic,
      Can you try manually importing the .dll, add the reference to the editor and compile?
      Excuse me, I don't quite understand what exactly I have to do.



      In attachment:
      i_Lib.cs - my custom library;
      i_ChartTemplate.cs - indicator that using i_Lib;
      I_Chart_Template__I_Lib.zip - protected assembly, that contain i_ChartTemplate.cs and i_ChartTemplate.cs

      I can do assemly, but I cannot import it.
      Attached Files
      Last edited by fx.practic; 03-12-2015, 02:15 PM.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Originally posted by NinjaTrader_Cal View Post
        Fx.Practic,
        Can you try manually importing the .dll, add the reference to the editor and compile?
        I am understand. Trying now.
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment


          #5
          I put dll to bin\Custom folder, add referense, compile an indicator, restart NT and I don't see i_Chart_Template indicator. Did I miss something?
          Attached Files
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Hello fx.practic,

            To check if you have other assemblies imported into NinjaTrader:
            • From the Control Center select the Tools menu -> select the Edit NinjaScript menu item -> select Indicator
            • Select any indicator and double click on it (we need only to open and compile one script to see all compile errors for all files).
            • Right-click the code editor -> select References...
            • Take a screenshot of this window and post the screenshot.


            To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool.

            Click here for instructions

            Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

            Click here for detailed instruction
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Got it!

              I moved to bin\Custom folder both X64 and X86 dll's, but add reference only at X64.

              It works.

              Thank You, NinjaTrader_Cal !
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by yertle, Yesterday, 08:38 AM
              7 responses
              28 views
              0 likes
              Last Post yertle
              by yertle
               
              Started by bmartz, 03-12-2024, 06:12 AM
              2 responses
              21 views
              0 likes
              Last Post bmartz
              by bmartz
               
              Started by funk10101, Today, 12:02 AM
              0 responses
              4 views
              0 likes
              Last Post funk10101  
              Started by gravdigaz6, Yesterday, 11:40 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by MarianApalaghiei, Yesterday, 10:49 PM
              3 responses
              10 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X