• 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.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with EMA SMA Cross

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

  • Derek Lane
    started a topic Help with EMA SMA Cross

    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

  • sandman
    replied
    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

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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.

    Leave a comment:


  • Derek Lane
    replied
    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

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by TraderCAD, Today, 04:27 PM
1 response
3 views
0 likes
Last Post TraderCAD  
Started by DavidHP, Today, 04:11 PM
0 responses
1 view
0 likes
Last Post DavidHP
by DavidHP
 
Started by alexstox, 03-24-2019, 01:07 PM
6 responses
54 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by fredfred, Today, 11:29 AM
3 responses
11 views
0 likes
Last Post NinjaTrader_JoshG  
Started by swcooke, Today, 10:38 AM
3 responses
12 views
0 likes
Last Post NinjaTrader_Jesse  
Working...
X