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

to create an NinjaTrader native alert promatically

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

    to create an NinjaTrader native alert promatically



    it's a long shot, but is it possible to programmatically create above native alert? that would save a lot of lines of custom triggering logic codes.

    #2
    You may find this is what you are looking for: https://ninjatrader.com/support/help.../nt8/alert.htm

    Thanks.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    Comment


      #3
      Originally posted by jeronymite View Post
      You may find this is what you are looking for: https://ninjatrader.com/support/help.../nt8/alert.htm

      Thanks.
      thanks for the reply. but actually that's not what I'm looking for. I read it but that Alert() only displays alert message upon called.

      I was hoping to set up Ninjatrader native alert with triggering logic configured, so that I don't need to write this triggering logic myself.

      Comment


        #4
        Hello leontancfa,

        Thanks for your post.

        To create alerts programmatically in a custom NinjaScript, you would need to code the logic into your script that triggers the alert to fire and call the Alert() method.

        The Strategy Builder could be used to set up the condition(s) to trigger the alert and call the Alert() method. Then, you could click the 'View code' button to see the generated syntax.

        See the help guide documentation below for more information.

        Alert(): https://ninjatrader.com/support/help.../nt8/alert.htm
        Conditions: https://ninjatrader.com/support/help...on_builder.htm
        Actions: https://ninjatrader.com/support/help...t8/actions.htm

        Let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          @NinjaTrader_BrandonH​:

          This is not a satisfying response as there is no reference at all on any object usable from c#.
          There is no place we can find sample on how to set an alert programmaticaly.

          There are no reference available on some objects used by the alerts. Condition for exampl, AlertConditionItem is another example.

          Comment


            #6
            Hello Philippe56140,

            The help guide provides a code example. Scroll to the bottom of the help guide page.

            Code:
            if(RSI(14, 3)[0] >= 20)
            Alert("myAlert", Priority.High, "Reached threshold", NinjaTrader.Core.Globals.InstallDir+@"\sounds\Aler t1.wav", 10, Brushes.Black, Brushes.Yellow);


            Where you have mentioned:
            There are no reference available on some objects used by the alerts.
            I don't quite understand what this means..

            Alerts have a string message that appears in the Alerts Log window, and can play a sound. When you say available objects, use ToString() on the object if you want to put text about the object in the message.
            Code:
            Alert("myAlert", Priority.High, [B]order.ToString()[/B], NinjaTrader.Core.Globals.InstallDir+@"\sounds\Aler t1.wav", 10, Brushes.Black, Brushes.Yellow);
            That I am aware of, AlertConditionItem is not an object type in NinjaScript.

            Note, programmatically means programmed with code in C#. There is also the Alerts window, if you want to set up alerts on a chart with a point and click interface.


            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by lorem, Today, 09:18 AM
            0 responses
            2 views
            0 likes
            Last Post lorem
            by lorem
             
            Started by hazylizard, Today, 08:38 AM
            4 responses
            11 views
            0 likes
            Last Post hazylizard  
            Started by geddyisodin, Today, 05:20 AM
            2 responses
            20 views
            0 likes
            Last Post geddyisodin  
            Started by Max238, Today, 01:28 AM
            5 responses
            47 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by giulyko00, Yesterday, 12:03 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X