Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple Code

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

    Simple Code

    Hello

    I have a simple request if coders may. There is a plain ema color indicator in the following link http://www.ninjatrader.com/support/f...ad.php?t=43611 .

    attached by the name ColoredEmaNT7.zip


    Could someone graciously add a sound alert to the code so that it would get triggered when ema changes color.

    I would really appreciate it.

    Thank you

    #2
    Hello,

    You should be able to add this and customize it to your preferences very easily.

    In the OnBarUpdate() section of the code, please try replacing the following:

    Code:
            if (Rising(ColorEMA))
                {
                    PlotColors[0][0] = Color.Blue;
    [B]                Alert("Rising", NinjaTrader.Cbi.Priority.High, "EMA Rising", "Alert1.wav", 10, Color.Black, Color.Yellow);[/B]
                }    
                else if (Falling(ColorEMA))
                {
                    PlotColors[0][0] = Color.Red;
    [B]                Alert("Falling", NinjaTrader.Cbi.Priority.High, "EMA Faling", "Alert1.wav", 10, Color.Black, Color.Yellow);[/B]
                }
    More information on using the Alert() function can be found below:



    Please let me know if you have any questions and I'd be happy to help you get this working.
    Last edited by NinjaTrader_Matthew; 09-12-2011, 08:49 AM.
    MatthewNinjaTrader Product Management

    Comment


      #3
      thank you very much matthew..

      However, I have absolute no experience with coding.. I opened the indicator in edit script and copied what you posted over what what written but bunch of errors came up "statement expected"...

      Will the modification you posted fire an alert with each bar that closes or not.

      I am hoping for something that would trigger when ema changes color but if the next bar has the same color of the ema it wont fire..

      again thank you very much..

      Comment


        #4
        Hello,

        This would take some extra steps, but definitely possible.

        We do not normally do this, but we will have one of our NinjaScript trainees look into this as a practice exercise. You should be getting a response in this thread once it is completed or if more information is needed from you to finish.

        If you have limited time or programming capabilities, you can discuss your requirements with any of our NinjaScript consultants.
        MatthewNinjaTrader Product Management

        Comment


          #5
          I can't thank you enough. I really appreciate this matthew.!

          Comment


            #6
            ColoredEMAwAlerts

            Chrismayerinmarket,

            Please find attached the requested indicator. I have tested it out on Gold and some Forex pairs and it appears like it is working great.

            To see the Alerts, you will need to go to File > New > Alerts, though there should be a sound that plays when a new alert from this indicator is triggered.

            In the Alerts window, when the EMA goes from Blue to Red, it will alert you in Red "EMA Falling", and when the EMA goes from Red to Blue, it will alert you in Blue "EMA Rising".

            For future modifications, I would suggest visiting some of our NinjaScript certified consultants at the link below :

            Attached Files
            Adam P.NinjaTrader Customer Service

            Comment


              #7
              Hello

              Thank you very much for your help adam. I have just been able to test the indicator you have attached. I tried to compile it with the original ColoredEMA.cs present... it didn't allow me... So I compiled it alone and it compiled fine....

              However I don't see any alerts.. I open a chart, load coloredemawalerts indicator..there is no option in the indicators window to view or select alerts...

              I did as you suggested to open an alert window.. but there is no sign of the ema alerts there nor an option to load the indicator in the alert..

              I really appreciate your help,,

              Comment


                #8
                Chris,

                I am happy to help.

                If you go to File > New > Alerts, an Alert window should pop-up. One thing to remember is that these alerts will only work in real-time and ignored on historical data. So basically, it may take awhile for the alert to trigger until the market changes trend locally.

                Please let me know if I can assist further.
                Adam P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by arvidvanstaey, Today, 02:19 PM
                4 responses
                11 views
                0 likes
                Last Post arvidvanstaey  
                Started by samish18, 04-17-2024, 08:57 AM
                16 responses
                61 views
                0 likes
                Last Post samish18  
                Started by jordanq2, Today, 03:10 PM
                2 responses
                9 views
                0 likes
                Last Post jordanq2  
                Started by traderqz, Today, 12:06 AM
                10 responses
                18 views
                0 likes
                Last Post traderqz  
                Started by algospoke, 04-17-2024, 06:40 PM
                5 responses
                48 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X