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

Names of indicators are empty

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

    Names of indicators are empty

    Here are two pieces of code that work as expected on my computer

    1. Find rectangles drawn by aomSDZones indicator

    foreach (DrawingTool draw in DrawObjects.ToList())
    {
    if (draw is DrawingTools.Rectangle)
    {
    DrawingTools.Rectangle Rect = draw as DrawingTools.Rectangle;

    if (Rect.DrawnBy != null)
    {
    if (Rect.DrawnBy.Name.Equals("aomSDZones"))
    Print("Rectangle " + Rect.Tag + " is drawn by aomSDZones");
    else
    Print("Rectangle " + Rect.Tag + " is drawn by " + Rect.DrawnBy.Name);
    }
    else
    Print("Rectangle " + Rect.Tag + " drawn manually");
    }
    }

    2. Print names of indicators configured on the chart

    if (ChartControl != null)
    {
    ChartObjectCollection<NinjaTrader.Gui.NinjaScript. IndicatorRenderBase> indicatorCollection;
    foreach (NinjaTrader.Gui.NinjaScript.IndicatorRenderBase indicator in indicatorCollection)
    {
    Print ("Found Indicator " + indicator.Name);
    if (indicator.Name.Equals("aomSDZones"))
    {
    Print (Name + ": * * * Found our aomSDZones indicator* * * ");
    }
    }
    }

    However, on another computer names of all indictors are empty. I mean Rect.DrawnBy.Name from the 1st piece and indicator.Name in the 2d.

    What can cause such effect? Exactly the same source code is being compiled on both computers.

    #2
    Is the NinjaTrader 8 version the same on both machines?

    Go to Control Center -> Help -> About

    Same version number on both machines?

    Comment


      #3
      Hello LeonK,

      Just a heads up NinjaTrader.Gui.NinjaScript.IndicatorRenderBase is not documented.

      That said, if you change the name of the Documents\NinjaTrader 8 folder and run the repair from the 8.0.24.3 installer to regenerate a clean environment folder, is the behavior the same?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hello, Chelsea,

        1. I have upgraded NT8 to the newest version. Still, SW can not find an indicator name.
        2. I did repair SW installation. Same result, can not find an indicator name.


        Thank you

        Comment


          #5
          Hello LeonK,

          Did you rename the Documents\NinjaTrader 8 folder before running the repair?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6

            Hi Chelsea

            yes. I've tried both repair and fresh install on the second machine with the same result - all my indicators work except for this one that relies on indicators names. The names remain empty.

            Thanks

            Comment


              #7
              Hello,

              Are the 'names of all indictors'.. empty?

              If its just this one its probably an issue with the code of that one indicator.

              But if all indicator names, especially the system indicators included with NinjaTrader, are not showing I think its an install problem.

              Do the indicators show in the Indicators window?
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                if all indicator names, especially the system indicators included with NinjaTrader, are not showing I think its an install problem.
                Hi Chelsea,

                trying the system indicators was a very good idea! So here is an update: most system indicators' names are shown, but NONE of the vendors indicators, not just mine(!), are shown.

                Here is a link to the screen shot of the Indicators page: https://app.box.com/s/diz2vbvpbybuzqu2db93nsr7iafoqzcf

                The following indicators have been configured:

                DrawingToolTile

                ncatOpeningTick
                ncatOpeningTick
                Bar Status by ninZa.co
                NetChangeDispaly

                aomSDZones
                aomManulStrategy

                ADX
                ATR
                APZ

                Here is the printout:

                Found Indicator
                Found Indicator
                Found Indicator
                Found Indicator
                Found Indicator
                Found Indicator
                Found Indicator
                Found Indicator ADX
                Found Indicator ATR
                Found Indicator APZ

                As you can see all indicators are accessible from the code but only three out of 10 show their names. aomSDZones and aomManualStartegy are my code, the first one and the last three are "system" indicators and the rest are from other vendors.

                Thanks




                Comment


                  #9
                  Hello LeonK,

                  If you create a new indicator from the NinjaScript Editor and don't modify the code, is the new indicator affected?

                  It may be the undocumented object type does not support the properties you want from it.

                  Is it an issue with the cast to IndicatorRenderBase and not as an Indicator?

                  I've often used another undocumented code to list the indicators.
                  Type[] availableIndicatorTypes = NinjaTrader.Core.Globals.AssemblyRegistry.GetDeriv edTypes(typeof(IndicatorBase));
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by LeonK View Post
                    As you can see all indicators are accessible from the code but only three out of 10 show their names.
                    Blanking out an indicator's label property has caused me grief from the beginning..
                    Although the type name does not necessarily have to match the indy name.. could try:

                    Code:
                    Print(indicator.GetType().ToString().Replace("NinjaTrader.NinjaScript.Indicators.", String.Empty));
                    Might be able to save you some time, or possibly even give you some additional ideas here..

                    https://youtu.be/mcs1jyk5ejg?t=206


                    Be Safe!

                    -=Edge=-
                    NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

                    Comment


                      #11
                      -=Edge=- Thank you. I probably wound not resolve it without your suggestions.

                      @NinjaTrader_ChelseaB Instead of using .Name that is empty in many cases I used .GetType(() and it works just fine. Problem solved.

                      It looks to me like there is a bug somewhere in NinjaTrader8 in regards to the .Name.

                      Comment


                        #12
                        Hello LeonK,

                        The Name property can be changed with the Label parameter in the Indicators or Strategy window in the scripts parameters.

                        Are you finding that this Name property is not matching what is showing for this input in the parameters window?
                        Chelsea B.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by MarionCron, Today, 11:43 PM
                        0 responses
                        1 view
                        0 likes
                        Last Post MarionCron  
                        Started by kaywai, Today, 11:20 PM
                        0 responses
                        1 view
                        0 likes
                        Last Post kaywai
                        by kaywai
                         
                        Started by JodieThur, Today, 11:11 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post JodieThur  
                        Started by cryfgg, Today, 06:01 PM
                        0 responses
                        18 views
                        0 likes
                        Last Post cryfgg
                        by cryfgg
                         
                        Started by Tremblinghandtrader, Today, 04:56 PM
                        0 responses
                        33 views
                        0 likes
                        Last Post Tremblinghandtrader  
                        Working...
                        X