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

IndicatorBaseConverter Error

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

    IndicatorBaseConverter Error

    Hello, I have created TypeConverter for my indicator according to docs. In the region - region NinjaScript generated code. Neither change nor remove. - I receive error during compilation:

    MyCustomConveter​.cs 'NinjaTrader.NinjaScript.Indicators.MyCustomConvet er'
    does not contain a definition for 'EqualsInput' and no extension method 'EqualsInput'
    accepting a first argument of type 'NinjaTrader.NinjaScript.IndicatorsMyCustomConvete r'​ could be found (are you missing a using directive or an assembly reference?)

    Could you please help me?

    #2
    Hello 09try,

    Thanks for your post.

    So we may accurately assist, please send us a screenshot of the error message in question and the TypeConverter code you are using in the indicator script.
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
    ​We look forward to assisting further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello Brandon,
      thanks for answer. I have attached screenshot and code. It's standard code as described in the docs

      https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?using_a_typeconverte r_to_custo.htm

      You will get error on lines 29, 34, 38 as you would need additional files. But in my opinion you can comment them out because they just add some values into collection and should not be a problem.

      MyCustomConverter.cs
      Attached Files

      Comment


        #4
        Hello 09try,

        Thanks for your notes.

        In the script you shared you must define an Indicator class in that file before the Type Converter class to resolve the compile errors. Currently, it is trying to use that Type Converter as an indicator.

        It seems IndicatorBaseConverter is inheriting from Indicator with how the code generator finds the indicator in the file and picked that up since the Indicator class is missing from the script.

        See this reference sample from the help guide demonstrating how to use a TypeConverter to customize property grid behavior: https://ninjatrader.com/support/help...r_to_custo.htm

        Attached is an example of this concept added to the code you shared which resolved the compile errors.

        Also, attached is an example of splitting this into different files as well which you might find helpful.
        Attached Files
        Last edited by NinjaTrader_BrandonH; 04-01-2024, 09:29 AM.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hello Brandon, I had my indicator in separate file. After I merged indicator and converter into single file I could compile.

          Thank you very much for your help!

          Comment


            #6
            @NinjaTrader_BrandonH​ - I see the example you provided, I am trying to do the same thing.. but it's not working for me.. I can get the Strategy Side to work perfectly but not the Indicator side. Can you confirm that this works with 8.1.3.0? It does compile but it does not seem to work https://youtu.be/i2eO0bOH8jQ

            Comment


              #7
              Hello ntcat,

              Thanks for your notes.

              To clarify, have you tested the sample scripts linked in post # 4 which demonstrates how this could be accomplished?

              The sample scripts linked in post # 4 were created using NT 8.1.3.0.

              When you mention "it does not seem to work" what exactly are you referring to that does not work?

              Are you seeing an error message in the Log tab of the Control Center when running the script? If so, what does it report?
              Brandon H.NinjaTrader Customer Service

              Comment


                #8
                NinjaTrader_BrandonH - I am sorry, did you see the video - https://youtu.be/i2eO0bOH8jQ

                I uploaded and imported directly without modification - I expected to click on a Check Marks ShowFairValueGaps, ShowFibRetracements and ShowOrderBlocks to reveal an options drop down to appear. I loaded a strategy that shows this behavior working.

                It's almost as if the indicator side is disabled from this feature.

                It does compile, and no errors show in the output.
                Attached Files

                Comment


                  #9
                  Hello ntcat,

                  Thanks for your notes.

                  That script was intended to only show how to structure a script to split the class into two files and compile successfully. It was not intended to be a fully functioning script.

                  With that knowledge, you could use this as a guide for your own original script to split the class into two files if that suits your use case.

                  For a fully functioning example of showing / hiding properties based on secondary input, please see the SampleIndicatorTypeConverter reference sample linked below.

                  SampleIndicatorTypeConverter: https://ninjatrader.com/support/help...r_to_custo.htm
                  Last edited by NinjaTrader_BrandonH; 04-17-2024, 01:03 PM.
                  Brandon H.NinjaTrader Customer Service

                  Comment


                    #10
                    Perfect.. I actually got this working. This is the first time I have seen the Base Converter work for an Indicator.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Graci117, Today, 09:02 PM
                    1 response
                    8 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by ETFVoyageur, Today, 07:55 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post ETFVoyageur  
                    Started by janio973, Today, 07:24 PM
                    1 response
                    7 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by aligator, 01-06-2022, 12:14 PM
                    4 responses
                    248 views
                    0 likes
                    Last Post john_44573  
                    Started by reynoldsn, Today, 05:56 PM
                    0 responses
                    15 views
                    0 likes
                    Last Post reynoldsn  
                    Working...
                    X