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

EMA with alert wanted

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

    EMA with alert wanted

    Would anyone be willing to code or share this, please (assuming NinjaTrader did not make this standard while I wasn't looking) ? All I want is a sound alert when price touches an EMA.

    The only reason I keep TradeStation running is because this is standard within TS & has been for years.

    I would appreciate NOT being referred to the Strategy Wizard or any other programming resource : I'm a trader, not a programmer, & I am requesting a VERY basic function.

    C'mon, Ray, get off that snowboard and write me some code !

    #2
    Hello jtrade,

    While there are a lot of similar threads on this yes, I am not aware of any that actually have an indicator that will do this.

    It is possible to code inside of the Strategy Wizard, I have attached an example of how this can be done inside of the Strategy Wizard. Note that the EMA will have to be exactly the same value as the Close in this for example on the ES the EMA will have to be 1750.50 and the Close has to be 1750.50 before it will send and Alert.

    To Import
    1. Download the attached file to your desktop
    2. From the Control Center window select the menu File > Utilities > Import NinjaScript
    3. Select the downloaded file

    Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.
    Attached Files
    JCNinjaTrader Customer Service

    Comment


      #3
      Thank-you very much, JC - will check it out over the weekend (dinner time here now )

      Comment


        #4
        JC - I set COBC to False with the idea that when price crosses the ema there must be a point intrabar where the values are the same, but nothing happens. However, I note there is no alert input : is the strategy deliberately incomplete, ie. intended for me to open up & complete !?

        Comment


          #5
          Hi,

          The alert is in the strategy file.

          To clarify, were you starting the strategy on a chart, or were you trying to run the indicator?

          Please ensure you're running the AlertEMAPrice strategy from the Chart and that it is set to enable. You should then receive this alert when Price is equal to the EMA.

          More information on running a NinjaScript strategy from a chart can be found below:

          MatthewNinjaTrader Product Management

          Comment


            #6
            Hi, Matthew,

            Yes, on the chart, but NOT enabled . I see when I enable it, it draws a 21 MA on the chart (the one with the price marker on the attached chart), but still no sign of any alert...

            Edit : you can't see the price marker in the screenshot as the price marker obscured it at that moment !

            School run time, so back later...
            Attached Files
            Last edited by jtrade; 10-28-2013, 07:58 AM.

            Comment


              #7
              Hello jtrade,

              The strategy created by JC checks that the EMA is exactly the close price. While this is what you are looking for, the close price is to an exact tick while the EMA is not.

              Its actually unlikely the EMA and close price will ever be exactly the same.

              So I have modified this script to add crossabove and crossbelow. If the EMA is the exact price of, crosses above, or crosses below then the alert will trigger.

              Let me know if this is still not what you would like.
              Attached Files
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Thank-you, ChelseaB - will give it a try & report back...

                Comment


                  #9
                  Fantastic - it works

                  One more little request to make it perfect : the EMA I use is actually a 21 EMA with a displacement 3 - could you please add a Displacement input ?

                  Comment


                    #10
                    Hello,

                    Does this mean that you will be using the EMA of 3 bars ago (because it is displaced three bars ahead)?

                    Also, you would like there to be a user defined input to control the displacement forward and how many bars ago of the EMA?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Hmmm... good questions.... & yes, the value I am looking at is indeed the value 3 bars ago.

                      Yes, a displacement input just like in the standard EMA indicator, please.

                      Comment


                        #12
                        ... & I changed it to Alert2, as Alert1 blows your ears out if you have music playing at a reasonable volume...

                        Comment


                          #13
                          Hi jtrade,

                          While it would be possible to do what you have suggested, this would be a bit more difficult to work out.

                          The issue is with the crossover. It is not possible to shift values as you are describing where you are comparing the current price bar to the EMA of 3 bars ago.

                          You could reach your goal by using a custom data series that saves the value of the EMA 3 bars ago and then using this for the input series in the crossover.

                          You will not be able to obtain this using the Strategy Wizard. As you request was initially very simple we did want to create this for you to offer better customer service.

                          However, as you are asking for changes that are somewhat complicated, I need to refer you to someone who is willing to assist you with your goal.

                          I need to mention that in the support department at NinjaTrader we do not create or modify code for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.

                          You can contact one of our professional NinjaScript Consultants who would be eager to assist you with your script.
                          http://www.ninjatrader.com/Ecosystem/NonBroker.php#81

                          Should you be interested in creating this yourself, below is a link to a sample that has an example of how to do this:
                          http://www.ninjatrader.com/support/f...ead.php?t=7299

                          I am also leaving this thread open to anyone who would like to assist you with your code.
                          Last edited by NinjaTrader_ChelseaB; 10-28-2013, 10:30 AM.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Understood, Chelsea, & many thanks to you & your colleagues for your good service.

                            Comment


                              #15
                              Unwanted label

                              Last question !

                              Is it possible to remove the EMA label that the strategy places on the chart (as you can see, I remove all labels, but the properties of the strategy-inserted EMA do not inlcude a Label input) ?
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by frankthearm, Yesterday, 09:08 AM
                              14 responses
                              47 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by gentlebenthebear, Today, 01:30 AM
                              2 responses
                              13 views
                              0 likes
                              Last Post gentlebenthebear  
                              Started by Kaledus, Today, 01:29 PM
                              2 responses
                              8 views
                              0 likes
                              Last Post Kaledus
                              by Kaledus
                               
                              Started by PaulMohn, Today, 12:36 PM
                              2 responses
                              16 views
                              0 likes
                              Last Post PaulMohn  
                              Started by Conceptzx, 10-11-2022, 06:38 AM
                              2 responses
                              56 views
                              0 likes
                              Last Post PhillT
                              by PhillT
                               
                              Working...
                              X