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

Help with EMA SMA Cross

Collapse
X
 
  • 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!!

    Derek

    #2
    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

    Comment


      #3
      Thanks/Question?

      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!!

      derek

      Comment


        #4
        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

        Comment


          #5
          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

          Add
          private string soundfile = ".wav";

          Scroll down to the section

          #region Properties

          Add

          [Description("Sound for EMA/SMA cross. NT will look for this file in \\Program Files\\NinjaTrader\\sounds")]
          [GridCategory("Sound")]
          [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.

          sandman

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sidlercom80, 10-28-2023, 08:49 AM
          168 responses
          2,262 views
          0 likes
          Last Post sidlercom80  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by WeyldFalcon, 12-10-2020, 06:48 PM
          14 responses
          1,429 views
          0 likes
          Last Post Handclap0241  
          Started by DJ888, 04-16-2024, 06:09 PM
          2 responses
          9 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          41 views
          0 likes
          Last Post jeronymite  
          Working...
          X