• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.


No announcement yet.

Partner 728x90


Help with EMA SMA Cross

  • Filter
  • Time
  • Show
Clear All
new posts

    Help with EMA SMA Cross

    Hi There NT Friends.

    I am on NT 7 - Wanting an indicator (if possible not a strategy so I can leave chart trader on) to notify me when EMA line Crosses an SMA line (or can do both EMA if necessary) - then wanting to have .wav file that will notify me so I can evaluate a trade to see if I want to get in.....

    Does anyone know/have indicator that would work or could be slightly rewritten (I am not very good at programming :O) that would give me the heads up to evaluate a trade??

    Thanks so much!!


    Hello Derek Lane,

    Thanks for your post and welcome to the NinjaTrader forums!

    You can download the "moving average crossbuilder" indicator that will allow you to choose moving averages and various actions when they cross.

    Here is a link to the indicator download: https://ninjatrader.com/support/foru...d=4&linkid=426

    Here is a basic guideline of how to Import NinjaScripts.

    To import NinjaScripts you will need the original .zip file.

    To Import

    Download the NinjaScripts to your desktop, keep them in the compressed .zip file.

    From the Control Center window select the menu File> Utilities> Import NinjaScript

    Select the downloaded .zip file

    NinjaTrader will then confirm if the import has been successful.
    Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

    Once installed, you may add the indicator to a chart by:

    Right click your chart > indicators > Select the Indicator from the list on the left > New > OK
    Paul H.NinjaTrader Customer Service



      loaded the indicator - brilliant!!

      One question is it has the same .wav file for everything - could I record .wav files and add them to different indicators - for instance record a .wav that says "13 20 cross long 1 minute" so I know to look at that chart...

      Thanks again!!



        Hello Derek Lane,

        Thanks for your reply.

        Yes, you could have different sound waves for different instances of the indicator. In the indicator parameters is the sound wave file Alert1.wav. If you have a different sound file to use, you would need to enter the entire file path and name. Alternatively, if you place your sound files in C:\program files(x86)\NinjaTrader\Sounds then you would only need to specify the file name to use.
        Paul H.NinjaTrader Customer Service


          Derek. This may be helpful to you concerning the use of soundfiles in your EMASMA Cross indicator so that you can use different soundfiles without having to go into the code every time to change it. You basically replace the specific soundalert in the code with a place holder that you can thereafter name in the indicator menu.

          Open the indicator code through the indicator editor.

          Look for the alert line, something like this:

          Alert("myAlert", NinjaTrader.Cbi.Priority.High, "EMASMA cross", "Alert1.wav", 10, Color.Black, Color.Yellow);

          Replace "Alert1.wav", with e.g. soundfile. That is the placeholder. It then looks like this:

          Alert("myAlert", NinjaTrader.Cbi.Priority.High, "EMASMA cross", soundfile, 10, Color.Black, Color.Yellow);

          Scroll up to the section

          #region Variables

          private string soundfile = ".wav";

          Scroll down to the section

          #region Properties


          [Description("Sound for EMA/SMA cross. NT will look for this file in \\Program Files\\NinjaTrader\\sounds")]
          [Gui.Design.DisplayName ("Soundfile")]
          public string Soundfile
          get { return soundfile; }
          set { soundfile = value; }

          (Note: The bolded S must a be capital S.)

          Now press Compile.

          Now call up your indicator in any chart just to take a look. You should see a category entitled "Sound" and then "Soundfile | .wav". There you can now put in the name of any wave file you have created as long as it is in C:\program files(x86)\NinjaTrader\Sounds as Paul already said.

          If you wanted to create a different sound for a long or short condition you would just repeat the above with a differently named place holder.



          Latest Posts


          Topics Statistics Last Post
          Started by yeshujbp, Today, 08:10 PM
          0 responses
          1 view
          Last Post yeshujbp  
          Started by backtester831, Today, 06:54 PM
          0 responses
          1 view
          Last Post backtester831  
          Started by frayrengytrader, Today, 06:03 PM
          0 responses
          Last Post frayrengytrader  
          Started by JustAFish, Today, 05:29 PM
          0 responses
          Last Post JustAFish  
          Started by TraderCAD, Today, 04:27 PM
          1 response
          Last Post TraderCAD