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

Volume Alert Indicator

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

    Volume Alert Indicator

    Hi Everyone! I new to NinjaTrader and am trying to create just a basic indicator that I can put into Market Analyzer and run against an instrument list. All I'm trying to do is get an alert if the next bar is GT last bar by lets say by 250%. Here is what I have in the Indicator and it just doesn't seem to be working. I have the indicator in a column in Market Analyzer, on a 3 minute value, # of bars to look back 5, Price Type Close, and a Alert Condition set of value of 0. Am I doing this correctly? Thanks Joy

    if (Volume[0] < Volume[1] * 0.250)

    #2
    Hello Joy,

    Welcome to the NinjaTrader Support Forums!

    Just to make sure that I am understanding you correctly you are looking for an Alert when the next bar's volume is 250% "GT" (Greater Than?) than the previous one?

    If that is the case then you may try something like:

    if ( (2.5 * Volume[0]) > Volume[1] )
    // Do something.

    Let me know if you get better results with this.
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi,
      Thanks! Yes, that's what I am trying to do. I will try that tomorrow during market hours and let you know if that works.

      Comment


        #4
        Volume Alert Indicator

        Hi, I put the code you suggested in the Indicator. What do I select in the Market Analyzer Column Trigger condition? If I have the Alert Coded in the Indicator, what do I put for Condition and Value? Which one overrides the other? Do I take the alert out of the indicator script and set the value in the trigger? Their are volume numbers showing up in the column, shouldn't these be a 1 or 0? Sorry, just a little confused here. Thanks Joy

        Comment


          #5
          Hello Joy,

          Using the Market Analyzer to trigger your Alerts, you would want to set a "Plot" value a static number like 0 or 1 as you mentioned. So that when your Plot is 1 your Alert is triggered, but when its 0 it is not true.

          So when you do something like:

          if ( (2.5 * Volume[0]) > Volume[1] )
          {
          Value.Set(1);
          }
          else
          {
          Value.Set(0);
          }

          Then inside of the Alert Conditions you may check if the Plot is equal to 1 to trigger your alert.

          Let me know if you have any questions.
          JCNinjaTrader Customer Service

          Comment


            #6
            Volume Alert Indicator

            Hi, I put this in and I'm getting Statement Expected after Value.Set(1); I don't know what I am missing. Thanks for your help already!

            {
            if ((.250 * Volume[0]) > Volume[1] > 150000))
            {
            Value.Set(1);
            }
            else
            {
            Value.Set(0);
            }
            }

            Comment


              #7
              Here is the copy/pasted code: I'm getting an error after the Else. Something is not right. Please help. thanks Joy

              protected override void OnBarUpdate()
              {
              if ((.250 * Volume[0]) > Volume[1] && Volume[0] > 150000))
              {
              Value.Set(1);
              }
              else
              {
              Value.Set(0);
              }
              {
              //Alert("MyAlert3044", Priority.High, "MyVolumeAlert", @"C:\Program Files\NinjaTrader 7\sounds\AutoChase.wav", 60, Color.DodgerBlue, Color.White);
              }
              // Use this method for calculating your indicator values. Assign a value to each
              // plot below by replacing 'Close[0]' with your own formula.
              }
              #region Properties

              #endregion
              }
              }

              Comment


                #8
                I changed the code to read list this: However, I do not see 1 and 0 in the columns.

                protected override void OnBarUpdate()
                {
                if ((.250 * Volume[0]) > Volume[1] && Volume[0] > 150000))
                {
                Value.Set(1);
                }
                if ((.250 * Volume[0]) > Volume[1] && Volume[0] < 150000))
                {
                Value.Set(0);
                }
                // Use this method for calculating your indicator values. Assign a value to each
                // plot below by replacing 'Close[0]' with your own formula.
                }

                #region Properties

                #endregion
                }
                }

                Comment


                  #9
                  Hello Joy,

                  You should see one or the other but not both. What do you see inside of the Market Analyzer Column?
                  JCNinjaTrader Customer Service

                  Comment


                    #10
                    It shows up as various numbers. I'm not sure what they are, but they are not 1 or 0s.

                    Comment


                      #11
                      Hello Joy,

                      Can you attach your indicator to this thread so that I can look into this?

                      You can Export it as a Source File using the step from our Help Guide at the link below.
                      JCNinjaTrader Customer Service

                      Comment


                        #12
                        Howdy there,

                        why i cant compare the current volume with the volume x bars ago?For e.g.,here`s a formula that compars the two adjacent vol bars:

                        Volume[0] >Volume[1]

                        If i want to compare the x bars ago,it renders a blank chart.

                        Why can`t i compare,let`s say the current volume bar with the 1000 th bar ago,like this?:

                        Volume[0] >Volume[1000]


                        ??

                        Any suggestions?

                        Comment


                          #13
                          Originally posted by cachevery View Post
                          Howdy there,

                          why i cant compare the current volume with the volume x bars ago?For e.g.,here`s a formula that compars the two adjacent vol bars:

                          Volume[0] >Volume[1]

                          If i want to compare the x bars ago,it renders a blank chart.

                          Why can`t i compare,let`s say the current volume bar with the 1000 th bar ago,like this?:

                          Volume[0] >Volume[1000]


                          ??

                          Any suggestions?

                          Open the output window. You should have an error there?

                          Comment


                            #14
                            Originally posted by cachevery
                            i haven`t got any errors!as i said i just got blank chart.
                            You probably have errors, which is why your chart is blank.

                            Open the NT output window.

                            *These are RUNTIME errors, NOT COMPILE ERRORS.

                            Comment


                              #15
                              I don`t know,but it doesn`t open.Anyway,how do i compare the current volume to the volume x bars ago?I can only compare 2-3 bars ago maximum.Why?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by algospoke, Today, 06:40 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post algospoke  
                              Started by maybeimnotrader, Today, 05:46 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post maybeimnotrader  
                              Started by quantismo, Today, 05:13 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post quantismo  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              8 responses
                              168 views
                              0 likes
                              Last Post jeronymite  
                              Started by cre8able, Today, 04:22 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X