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

ADXVMA with Ninja 8 strategy builder

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

    ADXVMA with Ninja 8 strategy builder

    I am using strategy builder to build a strategy that looks at the custom indicator ADXVMA. The indicator includes coloring for rising, chop, and falling. I want to use those parameters in my strategy, such as is the indicator reading "rising", but strategy wizard does not show those parameters for choice. I have seen it is a +1, 0 or -1 for rising, chop and falling but there is no place to set those in strategy wizard.

    Any ideas?

    Oh, the "is rising" function does not work as the line may be slightly rising and will prove positive, but in actuality the indicator is still in chop mode. Slope >, <, = does not work either. Thanks
    Last edited by ms8274!; 01-06-2018, 04:35 PM. Reason: Update title

    #2
    Hello ms8274!,

    These controls are appearing in the Indicator window and can be set by the user?

    Or are you trying to use a plot value?

    Does the indicator have public plots?
    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


    Likely, the action is not a plot or value that is public and the script would need to be modified.

    An example of a script that makes a plot as a signal is attached.

    Also, I'm including a link to an indicator in the User App Share that uses this functionality.
    https://ninjatraderecosystem.com/use.../colortheplot/
    Attached Files
    Last edited by NinjaTrader_ChelseaB; 10-11-2022, 08:01 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      This Method seems to be working

      Thanks for your Help Chelsea...

      Quantismo

      Comment


        #4
        Hi Chelsea,
        This works for SMA, but what do I need to change to make it work with PPO, or any other indicators?
        such as if price closes > 9ema???

        thks
        Raymond

        Comment


          #5
          Hello willwin,

          Thank you for your note.

          You could modify the script to work with an indicator other than the SMA, such as the EMA, by using that indicator in the conditions of the script. For example, if we replace 'if (CrossAbove(SMA(7), SMA(15), 1) && last != 1)' on line 61 with 'if (Close[0] > EMA(9)[0] && last != 1)' then the script would check if the current Close is greater than EMA(9).

          Please see the attached modified example that demonstrates this.

          Let us know if we may assist further.
          Attached Files
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            Thank you Brandon for the quick reply and code. Much appreciated!
            Last edited by willwin; 12-20-2020, 05:17 PM.

            Comment


              #7
              I would like to know when the PPO 5,13,9 has a crossover ( 5 crosses >/< the 13) and alert me,
              or especially when I use market analyzer search to show if any instrument has the 5/13 cross over on the last bar .
              I have tried many things but have not come up with the correct method.
              Can you help?

              thks
              RGM

              Comment


                #8
                Hello willwin,

                Thank you for your note.

                The fast and slow periods for the PPO indicator are inputs used to calculate the plot named 'Default'. The fast and slow periods are not plots themselves so they cannot be used for comparisons. If you look at the source code for the PPO indicator in a NinjaScript Editor window (New > NinjaScript Editor) we can see the fast and slow periods are simply EMAs.

                Something you could do is to have your script check the two EMAs, EMA(5) and EMA(13), for a cross above/below condition followed by sending an Alert.

                Please see the attached example script I have modified to demonstrate how this would be accomplished.

                Let us know if we may assist further.


                Attached Files
                Brandon H.NinjaTrader Customer Service

                Comment


                  #9
                  ok thanks again for your huge help!
                  I am now trying to find exactly when the "last" price has "just" crossed above or below the 55EMA.
                  with your code above it gives me whether it is currently above or below but how do I find when it has just crossed on the last bar??
                  thks
                  RGM

                  Comment


                    #10
                    Hello willwin,

                    Thank you for your post.

                    To accomplish this you would need to use a crossover condition in your script that checks if the Close price crosses above/below the 55-period EMA. After setting up the crossabove/crossbelow conditions, you would need to run the indicator with a Calculate mode of OnEachTick or OnPriceChange. When Calculate is set to OnEachTick/OnPriceChange, the Close price will update for each tick or each change in price.

                    If you are using the Calculate mode of Calculate.OnBarClose then the value of Close[0] will represent the latest completed bars close and the currently forming bar is unknown until it closes.

                    To get the "live" price, you would need to change the Calculate mode to Calculate.OnEachTick. This will shift the bar references such that Close[0] will represent the current price at any moment.

                    See this help guide link for more information about Calculate - http://ninjatrader.com/support/helpG...?calculate.htm

                    Please let us know if we may assist further.
                    Brandon H.NinjaTrader Customer Service

                    Comment


                      #11
                      thank you, I will give it a try. thanks again!

                      Comment


                        #12
                        here are my screenshots
                        Attached Files

                        Comment


                          #13
                          the crossover code - I am looking for the result when on the last Close, Price has just crossed the 55EMA.
                          right now it does not filter this out as shown on my screenshots.
                          Attached Files

                          Comment


                            #14
                            Hello willwin,

                            Thank you for your note.

                            Please provide a brief description to clarify the issue that you are reporting so we may accurately assist.

                            Thanks in advance, I look forward to further assisting.
                            Brandon H.NinjaTrader Customer Service

                            Comment


                              #15
                              I am now trying to find exactly when on the "last" bar has "just" crossed above or below the 55EMA.
                              above screenshots show one of the results. It produced a stock that was just >55EMA, not when it just occurred on last bar.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by aa731, Today, 02:54 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post aa731
                              by aa731
                               
                              Started by thanajo, 05-04-2021, 02:11 AM
                              3 responses
                              470 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Started by Christopher_R, Today, 12:29 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post Christopher_R  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              166 responses
                              2,237 views
                              0 likes
                              Last Post sidlercom80  
                              Started by thread, Yesterday, 11:58 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post thread
                              by thread
                               
                              Working...
                              X