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

TypeConverter problem in DLL (doesn't work)

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

    TypeConverter problem in DLL (doesn't work)

    When I use TypeConverter in .cs files, it works well, like:


    [TypeConverter("MyNS.my_type_Converter")]
    public class MyIndicator : Indicator
    {
    }



    but when I compile it to .dll and load that dll, it doesn't work. Any ideas, why?

    #2
    Hello TazoTodua,

    Is the TypeConverter contained in the same DLL where it is being used or is this being used from another context? At the moment there are not any suggestions for using type converters in separate assemblies from where they will be used. You should be able to define a type converter in the indicator file its self in a custom namespace. You would need to use the fully qualified name as a string as shown. We have some examples in the following post of type converters being used from an indicator: https://ninjatrader.com/support/help...r_to_custo.htm

    If you are otherwise not seeing this work when contained in the same file, can you provide a working example which demonstrates the problem upon exporting it?

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

    Comment


      #3
      yes (i used string as fully qualifying name, like "MyNameSpace.MyTypeConverter"), but ah,yes - i was referring it from another .dll assembly.. and can you tell, why it is not possible, is that C# problem or NT issue?

      Comment


        #4
        Hello TazoTodua,

        Thank you for clarifying.

        I wouldn't have a specific reason here other than we have not had a fully working example of that concept demonstrated at this point. TypeConverter development is generally outside of our standard NinjaScript support so the content and information surrounding their use in the platform is fairly limited. I have seen in the past where using a type converter in a separate assembly did not work, however the solution for that case was to just put the type converter in the same file and that also worked for the user.

        Complex inheritance patterns or separations of code into multiple assemblies is not necessarily a standard supported concept so you may run into cases like this when creating complex design patterns spanning multiple assemblies. It is usually suggested to try to contain all reliant code in the same assembly to avoid these cases. If you have a very simple sample of the type converter being used along with the specific steps to reproduce the problem, I can review that further to try and see if this is a limitation or if something else is needed for that to work in this context. Otherwise the general suggestion would still apply to include this with your script.

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

        Comment


          #5
          Jesse, you rule! thanks for nice answer. At this moment, i'll consider your suggestion and will use in same file. However, that is against my behavior (because I use separate library.dll file where I have all my external codes and shared methods, so wanted to have some shared/repeated TypeConverter class to be used for all my indicators, however, now i have to copy-paste same code into multiple files, which is bad for me... but let's see)... thanks!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Kaledus, Today, 01:29 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frankthearm, Yesterday, 09:08 AM
          13 responses
          45 views
          0 likes
          Last Post frankthearm  
          Started by PaulMohn, Today, 12:36 PM
          2 responses
          16 views
          0 likes
          Last Post PaulMohn  
          Started by Conceptzx, 10-11-2022, 06:38 AM
          2 responses
          55 views
          0 likes
          Last Post PhillT
          by PhillT
           
          Started by yertle, Yesterday, 08:38 AM
          8 responses
          37 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Working...
          X