• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 Steve L, Today, 05:01 PM
          0 responses
          5 views
          0 likes
          Last Post Steve L
          by Steve L
           
          Started by Trader-Joe, Today, 04:06 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_ShawnB  
          Started by vantojo, Today, 04:06 PM
          0 responses
          4 views
          0 likes
          Last Post vantojo
          by vantojo
           
          Started by tonynt, Today, 02:39 PM
          2 responses
          12 views
          0 likes
          Last Post tonynt
          by tonynt
           
          Started by StevenNelson, Today, 12:23 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Working...
          X