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

Indicators Labels

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

    Indicators Labels

    Hi guys, I was looking for this subject, so i won't repeat it, but, i have no idea how it is called.. :S

    I was watching some videos lately, and i saw how a guy used the LABEL of 2 different indicators in the chart list.
    This 3rd Indicator had 2 string input paramenters, so he place the name of the 2 labels of the other 2 indicators and he gain access to both Indicators and then he was able to interact between each other and output that data.

    What I basicaly want to do, is to make a "Delta"(like a MACD, but more dynamic), where i can for example, output Plot1 - Plot2... and then show it into the chart.

    Thanks for your time, greetings.
    Last edited by Fernand0; 05-22-2018, 06:37 AM.

    #2
    Hello Fernand0,

    Thanks for the post.

    What the individual likely did was parse the string label in his code to figure out what indicator to use along with its parameters. Then, using a switch statement or conditional filtering, they instantiated the parsed result.

    You could follow this publicly available link on how to parse a string for different components.

    The Split method returns an array of strings split from a set of delimiters. It's an easy way to extract substrings from a string.


    If you could post the video you watched I will clarify further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the fast reply Chris.

      MORE INFO - MAS INFORMACION : https://forms.gle/BJB4e9RSQ6H3CXAR9 On this video we explain a trade setup where we trade breakouts of the lines painted by the...

      MORE INFO - MAS INFORMACION : https://forms.gle/BJB4e9RSQ6H3CXAR9 On this video we explain a trade setup where we trade breakouts of the lines painted by the...


      I don't think he's doing what you are saying.

      BTW: it would be so nice to have a "reference" for indicators

      let's say that i want to have this list of indicators in my chart:

      1 - Momentum(..)
      2 - SMA(Momentum(..)
      3 - HMA(SMA(Momentum(..)

      IS A NIGHTMARE!!

      it would be much faster:

      1 - Momentum(..) as "M"(let's say.. a label)
      2 - SMA("M") as "SMA1"
      3 - HMA("SMA1")

      there is no way to do something like that? i would be able to do that if i know how to "get the indicator" by a label, like in the video.

      Comment


        #4
        Hello Fernand0,

        Thanks for your patience.

        It is hard to tell exactly how they do that without the source code but you can get a list of indicator with the ChartControl object.

        EX:

        Code:
        		private EMA myEMA;
        
        		protected override void OnBarUpdate()
        		{
        			if (CurrentBar < 1) return;
        			ChartObjectCollection<NinjaTrader.Gui.NinjaScript.IndicatorRenderBase> indicatorCollection = ChartControl.Indicators;
        			
        			foreach (NinjaTrader.Gui.NinjaScript.IndicatorRenderBase indicator in indicatorCollection)
        			  {
        			     if(indicator.Name == "EMA")
        				 {
        				 	myEMA = indicator as EMA;
        					 Print(myEMA.Period);
        				 }
        			  }
        			  
        		}
        https://ninjatrader.com/support/help...indicators.htm - ChartControl

        Using intelliprompt in the NInjaScript editor will allow you to see the available properties that you have available to in the indicator variable. Be sure to cast the IndicatorRenderBase object to the indicator that you need to get the properties.

        Please let us know if we may be of any further assistance.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          yes, i think that's how, but i have a problem, most of the time NinjaTrader stops

          i even tried with OnRender... still crashing.

          Any idea?
          Attached Files

          Comment


            #6
            Hello Fernand0,

            Thanks for the follow-up.

            I attached an example script that works. Please import this and let me know how it works for you.

            To import, go to Tools>Import>NinjaScript Addon.

            Please let me know if I may be of any further assistance.
            Attached Files
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Thanks Chris

              It worked perfectly, sometimes. No errors or crashes, but eventually..
              I attach the screenshot, that Error is "new", first time i see it.
              After this.. i tried creating the same indicator... but just with Print(indicator.Name) (more simple code)... and it crashes.. always......

              I fulfill all the requirements of the platform, why do i have crashes and sometimes it gets slow? Especially with the Analyzer...

              I have 16GB

              AMD Radeon R7 200 Series
              More than 60GB free at Hard Drive

              I don't know what's happening
              Attached Files
              Last edited by Fernand0; 05-25-2018, 09:04 PM.

              Comment


                #8
                Hello Fernand0,

                Thank you for your response.

                Please send me your log and trace files so that I may look into what occurred.

                You can do this by going to the Control Center-> Help-> Mail to Platform Support.

                Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

                Please list 'ATTN: Patrick H' in the subject line and reference this thread in the body of the email.

                I look forward to assisting you further.

                Comment


                  #9
                  Hello Fernand0,

                  Thank you for your patience.

                  In the case of the video from the third party, they are not getting the indicators from the chart at all. They are passing an Input Series into the indicator and then calling it's values and plotting them. That is all.

                  Please let me know if you have any questions.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by trilliantrader, Today, 08:16 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post trilliantrader  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  9 responses
                  174 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by funk10101, Today, 08:14 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post funk10101  
                  Started by adeelshahzad, Today, 03:54 AM
                  1 response
                  13 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by RookieTrader, Today, 07:41 AM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X