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

indicator not showing in strategy builder

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

    indicator not showing in strategy builder

    hello
    i have an indicator that I use on the chart and it is working fine but when I go to strategy builder, i do not see it under indicator. what can I do to have it shown in the strategy buildeR?

    #2
    Hello babouin77,

    The indicator will need plots added with AddPlot() and the Values[plot index] generated for these be returned in a public series<double> property.

    Below is a link to a forum post that discusses.
    I'm trying to expose my variables to the strategy builder so everyone can have better use of the WaveTrend indicator (it has a lot of code). Explain this to me like I am 5 because this isnt the first time I've tried to figure it out and hit a wall. What is Series? I know its like an array that stores bars. Why not just call it
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I'm trying to use DivergenceInputSeries indicator in strategy builder. What specific add-on do I need to make to this indicator to use it in strategy?

      Comment


        #4
        Hello Nyman,

        The indicator would need to be modified to add a plot and set a plot value.

        See the forum post linked in post #2 for details.
        hello i have an indicator that I use on the chart and it is working fine but when I go to strategy builder, i do not see it under indicator. what can I do to have it shown in the strategy buildeR?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea,

          Thanks for providing the information in that link. It helped solve part of the problem. However, where to assign plot values in the if -else logics is still unclear to me.

          Comment


            #6
            Hello Nyman,

            Are you viewing the code of the example? Line 64 is where the Values collection is set.

            Are you unsure how to assign a value to a variable?

            Are you getting an error?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              The example is straightforward because it's looking for a crossover. However, the DivergenceInputSeries Indicator where do I assign the variables in the example of line 64, 74, and 81. I would like to know when a divergence of price and some other series has occurred. One place would be in line 222 perhaps since the signaldn is true and the other in line 184 since the signalup variable is true. Is this correct?

              Comment


                #8
                Hello Nyman,

                Wherever the action is you want plotted, that would be where the plot Value is assigned.

                If you want this assigned when a condition is true, place the assignment in the action block for that condition set.

                if (/* my condition I want a value set from*/)
                {
                Values[0][0] = 1; // (1 would be replaced by the value you want to assign the plot)
                }


                Just as a heads up, DivergenceInputSeries is a custom script that is not included with the NinjaTrader Platform. You would need to evaluate the code and assign the plot from wherever is appropriate in that custom logic.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Chelsea,

                  Thanks for your reply. I get the part that DivergenceInputSeries is a custom indicator/script and I am hoping the developer of it could shed some light. But I think I know exactly where in the action block I would assign the plot values. Thanks for your suggestions and pointers.

                  Comment


                    #10
                    Hello. I have the same issue at the original poster (babouin77) and have read the various posts provided as solutions, however I am not understanding how to implement the solution. To be clear, I am not a coder. What I am looking to do is create a custom RSI indicator where the only changes are the period (change from the standard 14 to 5) and the upper and lower levels (from 70 to 69 for the upper) (30 to 29 for the lower). I would then like that custom indicator to appear in the Strategy Builder. Any assistance would be appreciated.

                    Comment


                      #11
                      Hello dmactrades,

                      Thanks for your note.

                      If you would like an indicator's value to be accessible in the Strategy Builder, you would need to add a plot to the script for each value you want to reference and assign a value to each of the plots. Once you create plots and assign them a value, those indicator plots will be accessible in the Strategy Builder.

                      You could make a copy of the RSI indicator that could be modified by going to Control Center > New > NinjaScript Editor.

                      Open the Indicators folder in the NinjaScript Editor window and double-click on the RSI file to open it. Right-click on the RSI code and select 'Save as' to save a copy of the indicator.

                      After making a copy of the indicator, you could change the Period from 14 to 5 within the State.SetDefaults section of OnStateChange() in the script.

                      If you would like the 70/30 (69/29) lines to display in the Strategy Builder, you would need to change the AddLine() methods in the RSI indicator script to AddPlot() methods and assign a value of 69 to one plot and 29 to the other plot.

                      See this help guide page for more information about AddPlot() and sample code: https://ninjatrader.com/support/help...t8/addplot.htm

                      Let me know if I may assist further.

                      Brandon H.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Brandon. I really appreciate you looking at this for me and helping. Below is a screenshot of what I have done however I must not be getting it right as the custom indicator isn't showing in the list of indicators when I try to add it to a chart or use it in the Strategy Builder. Any thoughts as to what I am doing incorrectly?

                        Comment


                          #13
                          Hello dmactrades,

                          Thanks for your note.

                          The AddLine() method and AddPlot() method do not assign values the same way. When using the AddLine() method, you would specify the value of the line in the AddLine() method. For example, the code below would create a line with a value of 70.

                          AddLine(Brushes.DarkCyan, 70, NinjaTrader.Custom.Resource.NinjaScriptIndicatorUp per);

                          That is not the correct way to assign a value to a plot. You would need to call the AddPlot() method within the OnStateChange() section of the script and then assign a value to the plot within the OnBarUpdate() method in the script. To assign a value to a plot, you could do Values[0][0] = X, where 'X' is the value you are assigning to the plot. If this plot is the third plot added to the script, you would call Values[2][0] = X.

                          See the AddPlot() help guide page linked below for more information and sample code: https://ninjatrader.com/support/help...t8/addplot.htm

                          Let me know if I may assist further.
                          Brandon H.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by cmtjoancolmenero, Yesterday, 03:58 PM
                          4 responses
                          23 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by Brevo, Today, 01:45 AM
                          1 response
                          14 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by rjbtrade1, 11-30-2023, 04:38 PM
                          2 responses
                          74 views
                          0 likes
                          Last Post DavidHP
                          by DavidHP
                           
                          Started by suroot, 04-10-2017, 02:18 AM
                          5 responses
                          3,021 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by Stanfillirenfro, Today, 07:23 AM
                          1 response
                          7 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Working...
                          X