Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help With Alert

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

    Help With Alert

    Hello Ninjas,

    I've defected from Esignal to NinjaTrader :-)

    I was wondering if someone could show me how to add an alert to a script. Basically, I would like a sound / pop up alert when the following line from the script is active

    Add(new Plot(new Pen(Color.LimeGreen,3), PlotStyle.Bar, "MFIUpVUp")); //Plot0


    The full script is as follows is attached.

    Cheers

    Carlton
    Attached Files

    #2
    carlton, you would need to call the Alert() or PlaySound() method when your condition is triggered :



    Comment


      #3
      Bertrand,

      Do you think you could show just this once. I've made a couple of attempts from the help site you provided but I failed....

      Would really appreciate it...

      Cheers mate...

      Comment


        #4
        You can try adding something like the below snippet to the conditions setting your plot of interest :

        if(mfiUp && volUp)
        {
        MFIUpVUp.Set(mfi[0]);
        MFIDnVDn.Reset();
        MFIUpVDn.Reset();
        MFIDnVUp.Reset();
        Alert("myAlert", NinjaTrader.Cbi.Priority.High, "MFI Signal", "Alert2.wav", 10, Color.Black, Color.Yellow);
        }

        Comment


          #5
          Thanks for that snippet.

          I'm going to apply it and see if I can get it to work.

          Cheers

          Comment


            #6
            Hi Bertrand,

            I've been trying to get the alert to work but nothing pops up.

            Can you tell me what I'm doing wrong?

            Cheers

            Comment


              #7
              After you've changed the code, did you compile your changes in by pressing F5 in the NinjaScript editor and then reloaded the indicator fresh and ensured the Alert window is up?

              Comment


                #8
                Ahhhhh,

                I did press F5 but I didn't check for the alerts window.

                Going to do that now.

                Ill let you know.

                Cheers mate.

                Comment


                  #9
                  Bertrand,

                  Forgive this newbie question, but can you let me know where to activate the alerts window?

                  Cheers

                  Comment


                    #10
                    Bertrand,

                    No worries mate... The sound alerts is just fine.

                    Cheers mate..

                    Comment


                      #11
                      Ok, great - the dedicated alerts window in found under File > New > Alerts.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      571 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      331 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      101 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      549 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      549 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X