Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to play a sound alert when EMA turns up or down

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

    How to play a sound alert when EMA turns up or down

    Hi,
    I'm new to Ninja Script and what I need is a piece of code which I could insert to a custom indicator in NinjaScript editor. I need EMA_Slope_Color indicator (or any other indicator as well) to play a sound alert when it turns from up to down or from down to up (= when it changes color). Staring monitor makes my eyes sore and you can't do that for a long time. Can anybody please help me with this? I have tried this myself for 2 days now but haven't been able to figure it out.

    Thanks

    #2
    Hello Masav,
    Welcome to the forum and I am happy to assist you.

    If you try the below code then are you able to trigger the alert as per your specifications.

    Code:
    if (CurrentBar < 2) return;
    if (Rising(EMA(14)) && EMA(14)[2] > EMA(14)[1])
    {
    	//do something
    }
    else if (Falling(EMA(14)) && EMA(14)[2] < EMA(14)[1])
    {
    	//do something
    }
    http://www.ninjatrader.com/support/h...tml?rising.htm
    http://www.ninjatrader.com/support/h...ml?falling.htm
    http://www.ninjatrader.com/support/h...html?alert.htm
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by glivv, Today, 09:17 AM
    0 responses
    5 views
    0 likes
    Last Post glivv
    by glivv
     
    Started by cmv727, Today, 08:48 AM
    0 responses
    6 views
    0 likes
    Last Post cmv727
    by cmv727
     
    Started by Kaiviti57, Today, 04:13 AM
    2 responses
    8 views
    0 likes
    Last Post bltdavid  
    Started by aslane, Today, 08:02 AM
    0 responses
    7 views
    0 likes
    Last Post aslane
    by aslane
     
    Started by DTSSTS, Today, 07:03 AM
    0 responses
    15 views
    0 likes
    Last Post DTSSTS
    by DTSSTS
     
    Working...
    X