• 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

  • TazoTodua
    started a topic TypeConverter problem in DLL (doesn't work)

    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?

  • TazoTodua
    replied
    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!

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:


  • TazoTodua
    replied
    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?

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    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.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by rickyblah12, Today, 01:01 PM
0 responses
6 views
0 likes
Last Post rickyblah12  
Started by dadarara, Today, 12:18 PM
0 responses
7 views
0 likes
Last Post dadarara  
Started by joemiller, Today, 07:33 AM
0 responses
8 views
0 likes
Last Post joemiller  
Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
7 responses
37 views
0 likes
Last Post DaveS
by DaveS
 
Started by claxxical, Yesterday, 10:00 PM
0 responses
11 views
0 likes
Last Post claxxical  
Working...
X