Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Alerts for multiple instruments & timeframes without (or with less) charts

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

    Alerts for multiple instruments & timeframes without (or with less) charts

    I have managed to create the alerts that I want to my satisfaction but I was curious as to whether there is any other way to have alerts trigger in particular instruments and timeframes without having to create a chart and apply the indicator that has the alert.

    For example:

    If I am monitoring the ES, MSFT and 6E and I would like to know when the bar crosses the 20 bar moving average in 5, 10, 15, 30 and 60 min time frames, is there any way to do this other than bring up 15 different charts and apply the indicator that I have created to each one?

    Thank you in advance.

    #2
    You could check out our Market Analyzer and add your indicator for the instruments and timeframes needed - http://www.ninjatrader-support.com/H...verview38.html

    Comment


      #3
      later the same day edit:
      --------------------------------

      I figured this one out too. Just plot whatever variable you want it to show and follow it with:
      AutoScale = false;
      PaintPriceMarkers =
      false;
      Overlay = false;
      I don't know exactly which is making it do what I want, but the important thing is that it's doing what I want.




      WOW!
      It's strange that a software that I've been using for over a year continues to impress me with "new" (to me) features that I find so useful. It's of an incredible help. Thanks for bringing it to my attention Bertrand.

      Now that I'm a little more familiar with it, how does one go about defining what number goes in the field of a particular column? For example, if an indicator simply draws rays at the High and Low of the session, then it's not plotting or returning anything. How does one go about making the Market Analyzer column display something useful like the current value of the High and Low that's been identified?

      Thanks many again.
      Last edited by 8DTK8; 08-20-2010, 10:56 AM.

      Comment


        #4
        45 min later edit:
        --------------------------------

        Some might be interested to know that not only session begin and end have to match up to your chart in the properties tab, but also the # of bars to look back. I matched up the session times, but was still getting double triggers at off times. It was because there weren't enough bars to get the indicator all the way back to the session start. I think the default value for # of bars to look back is 100. If you are looking at a 24 hour session with 2 min bars you need over 700 bars by the end of the day, not just the 100 default.

        Don't know if that somewhat convoluted clarification will help anyone, but it did solve my problem.





        15 min later edit:
        --------------------------------

        Nevermind. I found the properties tab for Market Analyzer. I hope this fixes it.

        Thanks


        ------
        One more question regarding something that I just noticed. I'm not sure if it's worth a new thread, so I'll post it here.

        It seems as though there's a discontinuity between the way bars are formed in a chart and the timing of the bar intervals in Market Analyzer.

        I'm looking at a chart for the ES 2 min and also have the ES in Market Analyzer. Both have the same indicator which calculates BarOnClose. I got an alert at 6:26 and then one for the same 2 min ES at 6:27. I checked the chart and it was the one that had a bar close at 6:27 so I can only guess that my Market Analyzer monitoring the same indicator in the 2 min ES was the one that triggered early at 6:26. Is there any way to get continuity so that the Market Analyzer is warning me about stuff that's happening on the particular charts that I'm looking at?

        This seems to be happening in the other bar intervals too. As I type, I noticed that the 10 min bar interval is closing at different times for the chart and Market Analyzer for the same instrument.

        Thanks.
        Last edited by 8DTK8; 08-20-2010, 08:11 AM.

        Comment


          #5
          I'm sorry for our late follow up reply, but great to hear you've got it solved, your understandings and conclusions are correct.

          Comment


            #6
            Originally posted by NinjaTrader_Bertrand View Post
            You could check out our Market Analyzer and add your indicator for the instruments and timeframes needed - http://www.ninjatrader-support.com/H...verview38.html
            I have some simple indicators that work but like 8DTK8 I want to eliminate the number of open charts. I want to use MA to help with that.

            I have read the Market Analzyer section in the help guide (that includes the alert, cell & filter conditions) and added my custom indicator as a column.

            Now all of my custom indicators are very simple and only based on simple IF() statements. With my charts I just use DrawText() or draw an arrow.

            My question is, in this case with boolean statements in the indicators where is the value in the column that displayed in MA coming from? That is, like the ADX >= 30 example I have values in MA (as opposed to True or False or 0 and 1 like I would want).

            i.e. I have a NR7 indicator that simply finds the narrowest bar out of 7. I want to print "NR7" for any instrument that I am following but the printed value in the column I do not understand.

            The only thing I can think of is I should add in a variable in the original code to store if it T/F then compare that as an alert in MA?

            Thx
            IJ

            Comment


              #7
              Originally posted by ij001 View Post
              I have some simple indicators that work but like 8DTK8 I want to eliminate the number of open charts. I want to use MA to help with that.

              I have read the Market Analzyer section in the help guide (that includes the alert, cell & filter conditions) and added my custom indicator as a column.

              Now all of my custom indicators are very simple and only based on simple IF() statements. With my charts I just use DrawText() or draw an arrow.

              My question is, in this case with boolean statements in the indicators where is the value in the column that displayed in MA coming from? That is, like the ADX >= 30 example I have values in MA (as opposed to True or False or 0 and 1 like I would want).

              i.e. I have a NR7 indicator that simply finds the narrowest bar out of 7. I want to print "NR7" for any instrument that I am following but the printed value in the column I do not understand.

              The only thing I can think of is I should add in a variable in the original code to store if it T/F then compare that as an alert in MA?

              Thx
              IJ
              Hi IJ, you're last sentence would be the way to go here - expose some signal series and then access it in the MA to be able to setup your text alert.

              Comment


                #8
                Originally posted by NinjaTrader_Bertrand View Post
                Hi IJ, you're last sentence would be the way to go here - expose some signal series and then access it in the MA to be able to setup your text alert.
                Update:

                I've added SendMail() in the code so when using Market Analyzer (no charts up) any instrument listed will deliver an email when the conditions of the indicator are met. Note that I changed the # of bars to look back = 10 (uses less RAM) and Calculate on Bar Close = True (Avoid email flood from every tick).

                Next I want the cell to change color when the indicator conditions were met. Through Trial and Error I found the indicator prints the value = Bar Close[0] in MA. Now, I can't compare that value with anything so I thought I could use 0 and 1 as I previously posted. I searched around the forums on how to actually do this and found this post:



                It says to use Value.Set() for 0 and 1. I went ahead and used it in the code and set the cell conditions in MA. So in MA it does indeed change color like I want. However when I go to bring up a chart b/c the 0 or 1 is plotted with the instrument (NQ in this case) the chart scale is messed up.

                How can I fix this?


                IJ


                Chart of Image is attached.

                NR7 Code is below.

                protected override void OnBarUpdate()
                {

                if (CurrentBar < 7) return;

                /* Set the value to 0 to compare against the cell conditions created in the Market Analyzer. */
                if (CurrentBar == 0)
                { return;
                Value.Set(0);
                }

                if (

                Math.Abs(High[0]-Low[0]) <= Math.Abs(High[1]-Low[1]) &&
                Math.Abs(High[0]-Low[0]) <= Math.Abs(High[2]-Low[2]) &&

                Math.Abs(High[0]-Low[0]) <= Math.Abs(High[3]-Low[3]) &&

                Math.Abs(High[0]-Low[0]) <= Math.Abs(High[4]-Low[4]) &&

                Math.Abs(High[0]-Low[0]) <= Math.Abs(High[5]-Low[5]) &&

                Math.Abs(High[0]-Low[0]) <= Math.Abs(High[6]-Low[6]) &&

                Math.Abs(High[0]-Low[0]) <= Math.Abs(High[7]-Low[7])
                )
                {
                BarColor = Color.Purple;
                SendMail("[email protected]", "[email protected]", "NR7 "+Close[0], "NR7");
                Value.Set(1); // Set the value to 1 to compare against the cell conditions created in the Market Analyzer.
                }

                }
                }
                Attached Files

                Comment


                  #9
                  I would suggest not using the Value series, but a custom DataSeries, your signal series so to speak, that would not be plotted on a chart per default but could be still accessed in the MA:

                  Comment


                    #10
                    Originally posted by NinjaTrader_Bertrand View Post
                    I would suggest not using the Value series, but a custom DataSeries, your signal series so to speak, that would not be plotted on a chart per default but could be still accessed in the MA:

                    http://www.ninjatrader.com/support/f...ead.php?t=4991
                    I went ahead and declared a custom DataSeries:

                    In #region Variables added:

                    private DataSeries myDataSeries;

                    In Initialize() added:

                    myDataSeries = new DataSeries(this); // this refers to the indicator

                    In OnBarUpdate():
                    IF()
                    {
                    myDataSeries.Set(1); //Set the value to 1
                    Print(myDataSeries[0]);
                    }

                    In the output window when the condition is satisfied it prints 1 okay but I'm still having a problem accessing them in the MA.

                    Recall, the cell conditions are set but with this custom DataSeries it will now not change color. (Note that I don't have the values plotted on the chart previously anymore.)

                    I feel something small is missing? Do any properties in the MA need to changed?

                    IJ

                    Comment


                      #11
                      IJ, you must expose this data series as public and then read the exposed data series in the Market Analyzer. This link demonstrates this concept - http://www.ninjatrader-support.com/v...ead.php?t=4991.
                      AustinNinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_Austin View Post
                        IJ, you must expose this data series as public and then read the exposed data series in the Market Analyzer. This link demonstrates this concept - http://www.ninjatrader-support.com/v...ead.php?t=4991.
                        Austin,

                        Can you clarify when you mean by data series as public? It is not as simple as changing the DataSeries class to public from private is it?

                        It looks like I'm on the right track, my code is similar to the concept in the link provided except it is the DataSeries class.

                        Also I have already gone into the MA and programmed the cell conditions for values of 0 and 1. That is what I assume you mean by expose the data series in the MA?

                        Comment


                          #13
                          It is almost that simple. The data series is private throughout, and then exposed at the end of the script with this:
                          Code:
                                  [Browsable(false)]
                                  [XmlIgnore()]
                                  public DataSeries MyDataSeries
                                  {
                                      get { return myDataSeries; }    // Allows our public MyDataSeries DataSeries to access and expose our internal myDataSeries DataSeries
                                  }
                          I just wrote a quick script to demonstrate this concept. It basically just multiplies the current price by 2 and prints that to the output window.
                          Attached Files
                          AustinNinjaTrader Customer Service

                          Comment


                            #14
                            I expanded the examples code:

                            I assume this?

                            // Important code segment in the Properties section. Please expand to view.
                            #region Properties

                            // Creating public properties that access our internal BoolSeries allows external access to this indicator's BoolSeries

                            [Browsable(false)]
                            [XmlIgnore()]
                            public BoolSeries BearIndication
                            {
                            get { return bearIndication; } // Allows our public BearIndication BoolSeries to access and expose our interal bearIndication BoolSeries
                            }

                            Comment


                              #15
                              ij001, that is the key component. Please see my post #13 in this thread for a more thorough explanation and sample code.
                              AustinNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

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