Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on creating an indicator dll

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

    Error on creating an indicator dll

    I have some problems in creating an indicator dll.

    It seems I don't really understand the help


    I developed an Indicator called TE_Entry_FirstHaltAt20 which is located in
    C:\Dokumente und Einstellungen\Besitzer\Eigene Dateien\NinjaTrader 6.5\bin\Custom\Indicator

    Then I created a file called

    C:\Dokumente und Einstellungen\Besitzer\Eigene Dateien\NinjaTrader 6.5\bin\Custom\NinjaTrader.TE_Entry_FirstHaltAt20. cs

    There I entered the using-declarations like described in the help and additionally I copied the 'NinjaScript generated code. Neither change nor remove.'-section from the indicator into the NinjaTrader.TE_Entry_FirstHaltAt20.cs

    at compile time the following error occures

    NinjaTrader.TE_Entry_FirstHaltAt20.cs;Der Typ NinjaTrader.Indicator.Indicator enthält bereits eine Definition für cacheTE_Entry_FirstHaltAt20.;CS0102 - click for info;18;42;

    which means :
    NinjaTrader.TE_Entry_FirstHaltAt20.cs;Der Typ NinjaTrader.Indicator.Indicator already contains a definition for cacheTE_Entry_FirstHaltAt20.;CS0102 - click for info;18;42;

    does anybody know whats wrong what I'm doing.

    And why is this process so complicated - a MenuItem 'create Dll' where the necessary step are performed automatically would quite need.

    and moving and copying around code is a potential source of errors as well - I think there could be a room for improvement.
    Last edited by TheChingachgook; 07-15-2009, 10:21 AM.

    #2
    TheChingachgook, you would only need this process if you want to reference a custom assembly in your code - if you don't need this then you can just create a DLL using the standard export procedure - http://www.ninjatrader-support.com/H...6/Export1.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks a lot ... but when I try to export an indicator I'm getting an error.


      it doesn't recognize some helper classes in the Indicator\UserdefinedMethod.cs which I implemented in the NinjaTrader.Indicator namespace.

      Type or namespace 'Pivothandler' couldn't be found (using directive or assembly reference missing)

      Comment


        #4
        This is unfortunately expected for methods defined in UserDefinedMethods - http://www.ninjatrader-support.com/H...verview45.html

        Best would be you port this method then to the indicator itself for export.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          It's quite complicated to do a simple thing:

          The helper classes I moved into a dummy indicator (TEHelper) and when I'm exporting both of them, then .... it seems ... the compiler will recognize the helper classes.

          But whenever I want to access such a class the type has to be exactly quailfied : e.g. NinjaTrader.Indicator.TEHelper.PivotHandler ....


          But now I stumple through the next hurdels:

          1)
          16.07.2009 12:17:12|2|4|Error compiling export assembly: c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\Indicator\TE_Entry_FirstHaltAt20.cs (113,10) : error CS0103: The name isLineReseted is not available in the current context.


          isLineReseted is a protected variable in the UserdefinedMethods Indicator class.

          2)
          16.07.2009 12:17:12|2|4|Error compiling export assembly: c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\Indicator\TE_Entry_FirstHaltAt20.cs (114,5) : error CS0103: The name ResetLine isis not available in the current context.

          --> this is a Method of the superclass in UserdefinedMethods ... so it seems that everthing what is coded in the Indicator superclass is useless by exporting the code.

          but I didn't get any comile-error when I compiled the whole stuff in the IDE.



          3)

          16.07.2009 12:17:12|2|4|Error compiling export assembly: c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\Indicator\TE_Entry_FirstHaltAt20.cs (175,17) : error CS0118: NinjaTrader.Indicator.ATR is a type, but is used as variable.

          -->> double atr = ATR(close, 5)[0];

          this line causes this compile error.... --- does that mean, that it is not allowed to use system indicators in exported Indicators???


          4)
          16.07.2009 12:17:12|2|4|Error compiling export assembly: c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\Indicator\TE_Entry_FirstHaltAt20.cs (181,23) : error CS0433: the Type NinjaTrader.Indicator.SMA is available in c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\NinjaTrader.Vendor.dll and c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\Vendor.MTP.dll .

          -->> and what does that mean?? ... I only would like to export an Indicator

          5)
          16.07.2009 12:17:12|2|4|Error compiling export assembly: c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\Indicator\TE_Entry_FirstHaltAt20.cs (181,23) : error CS0118: NinjaTrader.Indicator.SMA ist ein Typ, wird jedoch als Variable verwendet.


          -->> Not allowed to use the SMA


          Please help me....
          Last edited by TheChingachgook; 07-16-2009, 04:56 AM.

          Comment


            #6
            TheChingachgook, sorry for the frustrations - it sounds like you're having multiple methods with the same names present which causes the conflict. Please try commenting out the ones in UserDefinedMethods that you ported to an indicator for export usage.

            3 looks like a coding error as Close should start with a capital C.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hi Bertrand

              Thank you for your answer.

              No I cleaned up the superclass and duplicated the variables and the methods into the different indicators .... but I'm asking me, what is sense of the indicator superclass at all, if it is not allowed to put code in it??

              But the issues 3, 4 and 5 are not solved yet.

              I changed to code to 'double atr = ATR(Close, 5)[0]' now, but I'm still getting the same error.

              but anyway ... also 'double atr = ATR(close, 5)[0]' was compileable in the IDE and the strategy performed this indicator (and this codeline ) already by thousand times -> close is only a dataseries with special close values.

              the same Problem occures with every system indicator .. I just tried to use the EMA indicator .... no problem by compiling it in the NTScript editor.

              double ema = EMA (Close, 6)[0];


              But as soon I try to export this code I get the following errors again:

              1)
              16.07.2009 14:42:11|2|4|Error compiling export assembly: c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\Indicator\TE_Entry_FirstHaltAt20.cs (177,17) : error CS0433: Der Typ NinjaTrader.Indicator.EMA ist in c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\NinjaTrader.Vendor.dll und c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\Vendor.MTP.dll vorhanden.

              2)
              16.07.2009 14:42:11|2|4|Error compiling export assembly: c:\Documents and Settings\Benutzer\My Documents\NinjaTrader 6.5\bin\Custom\Indicator\TE_Entry_FirstHaltAt20.cs (177,17) : error CS0118: NinjaTrader.Indicator.EMA ist ein Typ, wird jedoch als Variable verwendet.

              It seems the problem is located somewhere else!?
              Last edited by TheChingachgook; 07-16-2009, 06:52 AM.

              Comment


                #8
                Thanks for your reply, sometimes you have to include explicitly the dependent system indicators for export with the strategy, please check into this link and see if it helps - http://www.ninjatrader-support.com/H...tProblems.html
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  it seems it's going to be a longer thread

                  In this link http://www.ninjatrader-support.com/H...ExportProblems the following issue is mentioned.

                  3. Under “Export objects”, select “System indicators”


                  but, when I look at my export dialog only I only see the following object types to select:

                  All
                  Indicators
                  Strategies

                  the item 'System indicators' is missing.

                  what might here be the problem - is this configurable somewhere

                  Comment


                    #10
                    Which NinjaTrader version are you running currently? Please ensure you're on 6.5.1000.11
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      ooops you are right .... I had not the current version ... what a shame


                      At this point I really must tell you, that you support guys a doing a great job here ... thank you very much

                      Comment


                        #12
                        You're welcome, thanks for the kind words!
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          I have a problem with this solution. Why would having the latest version make a difference? Does that mean everyone having an earlier version will have the same problem? No, of course not. My earlier version works correctly in this regard so why did TheChingachgook not see the “System indicators” while I can? See what I mean? There has been no solution presented here at all.
                          eDanny
                          NinjaTrader Ecosystem Vendor - Integrity Traders

                          Comment


                            #14
                            If you check into our release notes - http://www.ninjatrader-support.com/H...easeNotes.html

                            You'll notice item 2689 addresses the issues the poster reported, that's why we asked on which version he was...
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              I see, now I noticed my version is the one where the problem was fixed! You are off the hook Bertrand. It's just that I see so many of this kind of post and sometimes I like to see more in depth answers. Sorry bud.
                              eDanny
                              NinjaTrader Ecosystem Vendor - Integrity Traders

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by helpwanted, Today, 03:06 AM
                              1 response
                              14 views
                              0 likes
                              Last Post sarafuenonly123  
                              Started by Brevo, Today, 01:45 AM
                              0 responses
                              11 views
                              0 likes
                              Last Post Brevo
                              by Brevo
                               
                              Started by aussugardefender, Today, 01:07 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post aussugardefender  
                              Started by pvincent, 06-23-2022, 12:53 PM
                              14 responses
                              243 views
                              0 likes
                              Last Post Nyman
                              by Nyman
                               
                              Started by TraderG23, 12-08-2023, 07:56 AM
                              9 responses
                              387 views
                              1 like
                              Last Post Gavini
                              by Gavini
                               
                              Working...
                              X