Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Moving average crossover alert

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

    #16
    Hello,

    This seems to be another easy fix so I will post the result.

    So you know this is what I had changed to accomplish "Sticking" with the prior result.

    I changed the line:

    Code:
    OnlyCrossovers.Set(0);
    to

    Code:
    if(OnlyCrossovers.Count > 0)
    {
         OnlyCrossovers.Set(OnlyCrossovers[1]);
    }
    After the first crossover has been detected it will continue to set the prior result as the current unless there is a change. The change will update the data series so that the next check that happens the change would be reflected or "Sticky".

    Please let me know if I may be of additional assistance.
    Attached Files
    Last edited by NinjaTrader_Jesse; 09-29-2014, 11:41 AM.
    JesseNinjaTrader Customer Service

    Comment


      #17
      Market analyzer

      Hello,
      Could yo tell me if it is possible to use market analyzer to scan more than 500 products (stocts , futures , index, etc) whit the market closed?
      and who could help me to set the conditions I want to get?

      for example condidtions like: I want to Know, on a dayly at close, which product price crossed (above or below )an SMA 200 periods during that day.

      thanks

      Comment


        #18
        Hello PEPBOSCH,

        Thank you for the question.

        To answer your question NinjaTrader does have the capability to add many instruments at once to the Market Analyzer.

        With this being said you also have the control on what session hours you display in NinjaTrader for the instruments you select. If your broker / exchange allows for after hours trading or data as long as you configure the session template correctly you should see the values.

        I would recommend watching the Market Analyzer webinar we have if you have not already: https://www.youtube.com/watch?v=RQSp...56536A44DD7105

        For the conditions you are seeking, this would certainly be possible by creating a custom indicator for use with the Market Analyzer, this I don't think would be as simple as the modifications that originally started this thread.

        If you would like to email us at platformsupport @ ninjatrader.com we could give you some information regarding what would be needed to accomplish this and where you can find the resources to code this.

        Please let me know if I may be of additional assistance.
        JesseNinjaTrader Customer Service

        Comment


          #19
          PRICE only moving through selected moving average

          Hello,

          How can I create an alert that will pop up on chart when price action moves through my moving average.
          I want to point out this is not a moving average cross over question

          I'm assuming I have to modify or write a script for an indicator, if it is to write a new script can you post me some pointers please, I prefer if I can modify an already existing indicator.

          Thank you guys

          Comment


            #20
            Hello,

            I would like to first ask is this related to the market analyzer or is this a chart related question?

            If this Is a chart related question I will continue answering you in this post but in the future please choose the correct forum as this helps other users when they looking for the same information.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #21
              My apologies some times it's hard to find the right thread.

              This is a chart related question, after it's creation I want to be able to open indivators and add it to my chart.

              Thank you

              Comment


                #22
                Hello,

                Thank you for the clarification.

                For your question,

                This depends what sort of popup you are trying to create. Are you looking for some sort of text that appears on the chart or something that physically pops up?

                Also you said that this is not a moving average cross over question but you are asking for this to happen when the price moves through your moving average, do you mean when it crosses above or below the moving average? Can you please clarify this?

                You are correct you would need to create an indicator for this, I can assist you in providing the information to help you but we will need to clear up the above questions first.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #23
                  Originally posted by NinjaTrader_Jesse View Post
                  Hello,

                  Thank you for the clarification.

                  For your question,

                  This depends what sort of popup you are trying to create. Are you looking for some sort of text that appears on the chart or something that physically pops up?

                  Also you said that this is not a moving average cross over question but you are asking for this to happen when the price moves through your moving average, do you mean when it crosses above or below the moving average? Can you please clarify this?

                  You are correct you would need to create an indicator for this, I can assist you in providing the information to help you but we will need to clear up the above questions first.

                  I look forward to being of further assistance.
                  HI, as far as a "pop up ... a square (symbol) will do on the chart or even a sound alert.
                  About moving average cross I mean not 2 moving averages crossing etc.
                  I mean when price crosses above moving average a blue square appears on chart
                  Then when price crosses below moving average a red square appears on the chart
                  Thank you you've been great

                  Comment


                    #24
                    Hello,

                    Thank you for clearing that up.

                    For this sort of indicator there is actually not a whole lot of code required.

                    For the cross event, you can use something like the following to detect when the price crosses the MA. I will use an SMA for this example but you can replace this with which ever indicator you choose to use.

                    Code:
                    if (CrossAbove(Close, SMA(14), 1))
                    {
                         DrawSquare("CrossAboveSquare" + CurrentBar, true, 0, Close[0], Color.Green);
                    }
                    if (CrossBelow(Close, SMA(14), 1))
                    {
                         DrawSquare("CrossBelowSquare" + CurrentBar, true, 0, Close[0], Color.Red);
                    }
                    Something like this would draw a square each time the Cross above or below event happens.

                    Let me explain this a bit,

                    In the statement:
                    Code:
                    if (CrossAbove(Close, SMA(14), 1))
                    This would be comparing the Close data series against the SMA with a period of 14 data series, the 1 signifies a lookback period of 1, so this would check each bar if there was a cross on the last bar.

                    Code:
                    DrawSquare("CrossAboveSquare" + CurrentBar, true, 0, Close[0], Color.Green);
                    There is a important note here with the drawing objects, the tag name: "CrossAboveSquare" + CurrentBar will allow a new square to be placed and leaves the other squares that have already been placed alone because its tag name is unique, if the tag name was instead "CrossAboveSquare" only one square could be present on the chart at a time.

                    Here is some documentation for the methods used above:



                    This is the drawing section, the DrawSquare is one of many drawing methods so please adjust to your needs.
                    JesseNinjaTrader Customer Service

                    Comment


                      #25
                      Ok I will try this unfortunately I've run out of time to respond tonight but I'll try it and get back to you
                      Cheers
                      dline

                      Comment


                        #26
                        Jesse
                        is it possible for this indicator you posted in post #16 to alert crossover once per bar at the end of bar close, right now it alerts on every tick after crossover.
                        A stand alone pop up is also useful to draw attention with instrument name period and crossover time.

                        Comment


                          #27
                          Hello,

                          Can you please tell me what type of chart you are using this with?

                          I tried this on a few different types but was unable to get the results that you are, This would be expected if you were using it on a 1 tick or with CalculateOnBarClose as false.

                          I Look forward to being of further assistance.
                          JesseNinjaTrader Customer Service

                          Comment


                            #28
                            5 minute chart

                            Comment


                              #29
                              Hello,

                              I am unsure of this,

                              What do you have CalculateOnBarClose set to and also are you using a re arm time it looks like that is defined in the script as a user input.

                              I look forward to being of further assistance.
                              JesseNinjaTrader Customer Service

                              Comment


                                #30
                                It was false on bar close. Problem fixed. Thanks. What about adding a pop up message box?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by RookieTrader, Today, 07:41 AM
                                1 response
                                4 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by kujista, Today, 05:44 AM
                                1 response
                                9 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by elderan, Yesterday, 08:03 PM
                                1 response
                                12 views
                                0 likes
                                Last Post NinjaTrader_BrandonH  
                                Started by samish18, Yesterday, 08:57 AM
                                8 responses
                                25 views
                                0 likes
                                Last Post samish18  
                                Started by DJ888, 04-16-2024, 06:09 PM
                                3 responses
                                10 views
                                0 likes
                                Last Post NinjaTrader_Erick  
                                Working...
                                X