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 Spike Indicator

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

    Volume Spike Indicator

    Hi

    Anyone know if there are any indicators for volume spikes. Something like an audio alert or some chart marking on a volume spike like in a 1 min or a 5 min chart.

    Thanks
    RK

    #2
    I don't know of any preexisting ones, but you can definitely make one with no problem. You could do something like
    Code:
    if (Volume[0] >= Volume[1] * 1.10)
         PlaySound("Alert1.wav");
    or if you wanted a draw object you could do
    Code:
    if (Volume[0] >= Volume[1] * 1.10)
         DrawDiamond("Volume Spike" + CurrentBar, 0, Low[0] - TickSize, Color.Red);
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh. I appreciate it.

      If possible can you or anyone please add this code to a down oadable indicator file (.zip). I am still learning Ninja programming and am able to edit/play with an existing indicator by modifying the code. Have to learn how to build a new one from scratch

      I appreciate it.

      Thanks
      RK

      Comment


        #4
        I usually just use the NinjaScript wizard to generate the template for my indicator and just put in my algorithms into the OnBarUpdate() section.
        Attached Files
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Josh. I appreciate it.

          Any suggestions from anyone on which values the "spike" field in indicator should be? I tried "2" it was able to catch some spikes which met those conditions. So, for value of 2, the indicator is catching only volume spikes which are atleast 2 times greater than the previous volume bar. For example, if one bar is like 1000 contracts, and the next bar is like 3100 contracts, the indicator alerts.

          Any suggestions on improving the condition of the spike, something like greater than the average of last two bars or some combination like that?

          Thanks
          RK

          Comment


            #6
            josh ....

            do you have this indicator for NT 7 ... thanks

            Comment


              #7
              You can try the one attached for NT7.
              Attached Files
              BertrandNinjaTrader Customer Service

              Comment


                #8
                thanks.....

                Comment


                  #9
                  Originally posted by RK_trader View Post
                  Thanks Josh. I appreciate it.

                  Any suggestions from anyone on which values the "spike" field in indicator should be? I tried "2" it was able to catch some spikes which met those conditions. So, for value of 2, the indicator is catching only volume spikes which are atleast 2 times greater than the previous volume bar. For example, if one bar is like 1000 contracts, and the next bar is like 3100 contracts, the indicator alerts.

                  Any suggestions on improving the condition of the spike, something like greater than the average of last two bars or some combination like that?

                  Thanks
                  RK

                  try using the average volume(2) indicator instead of the volume indicator...

                  Comment


                    #10
                    Originally posted by NinjaTrader_Bertrand View Post
                    You can try the one attached for NT7.
                    Hi Bertrand,

                    Any chance you can add an alert to it?

                    Thanks

                    Comment


                      #11
                      Hi,

                      You can easily edit this indicator to add your own custom alert

                      Code:
                      			if (Volume[0] >= Volume[1] * (1 + Spike))
                                  {
                           			DrawDiamond("Volume Spike" + CurrentBar, true, 0, Low[0] - TickSize, Color.Gold);
                                     [B] Alert("myAlert", NinjaTrader.Cbi.Priority.High, "Reached threshold", "Alert1.wav", 10, Color.Black, Color.Yellow);[/B]
                      
                                  }
                      More information on the Alert methods can be found below:

                      MatthewNinjaTrader Product Management

                      Comment


                        #12
                        Originally posted by NinjaTrader_Matthew View Post
                        Hi,

                        You can easily edit this indicator to add your own custom alert

                        Code:
                        			if (Volume[0] >= Volume[1] * (1 + Spike))
                                    {
                             			DrawDiamond("Volume Spike" + CurrentBar, true, 0, Low[0] - TickSize, Color.Gold);
                                       [B] Alert("myAlert", NinjaTrader.Cbi.Priority.High, "Reached threshold", "Alert1.wav", 10, Color.Black, Color.Yellow);[/B]
                        
                                    }
                        More information on the Alert methods can be found below:

                        http://www.ninjatrader.com/support/h.../nt7/alert.htm
                        Many thanks Mat,seems working well.How do you add an alert to this: (attached)

                        Thanks
                        Attached Files

                        Comment


                          #13
                          SnakeEYE, you would key off the trend dataseries here exposing the internal signal of the technique.
                          So for example for an upswing you could check -

                          Code:
                          if (Trend[0] == 1 && Trend[1] == -1)
                          	Alert("myAlert1", NinjaTrader.Cbi.Priority.High, "up swing", "Alert1.wav", 10, Color.Black, Color.Yellow);
                          BertrandNinjaTrader Customer Service

                          Comment


                            #14
                            Originally posted by NinjaTrader_Bertrand View Post
                            SnakeEYE, you would key off the trend dataseries here exposing the internal signal of the technique.
                            So for example for an upswing you could check -

                            Code:
                            if (Trend[0] == 1 && Trend[1] == -1)
                            	Alert("myAlert1", NinjaTrader.Cbi.Priority.High, "up swing", "Alert1.wav", 10, Color.Black, Color.Yellow);

                            Hi Bertrand,

                            By ''key off'' you mean something like the double or tripple right slashes -'///'?

                            If so,where i put them in the code?

                            {
                            Trend.Set(Close[0] >= Open[0] ? 1 : -1);
                            Value.Set(Trend[0] == 1 ? Low[0] : High[0]);
                            return;
                            }

                            if(Trend[1] == 1)
                            {
                            double higherLow = Math.Max(Value[1], Low[0]);

                            if (High[0] < higherLow - TickSize * 0.01)
                            {
                            Trend.Set(-1);
                            Value.Set(High[0]);
                            }
                            else
                            {
                            Trend.Set(1);
                            Value.Set(higherLow);
                            }
                            }
                            else
                            {
                            double lowerHigh = Math.Min(Value[1], High[0]);

                            if (Low[0] > lowerHigh + TickSize * 0.01)
                            {
                            Trend.Set(1);
                            Value.Set(Low[0]);
                            }
                            else
                            {
                            Trend.Set(-1);
                            Value.Set(lowerHigh);
                            }
                            }

                            PlotColors[0][0] = Trend[0] == 1 ? ColorUp : ColorDown;

                            if (PaintBars)
                            BarColor = PlotColors[0][0];
                            }

                            Comment


                              #15
                              Sorry I'm not following you, with key off I meant for your signal / alert the trend series offered is then where you want to work with closely, as it would directly offer you what's needed to setup the alert condition. The snippet I've shown could be entered for example in the OnBarUpdate() below the paint bar condition.
                              BertrandNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by KennyK, 05-29-2017, 02:02 AM
                              3 responses
                              1,282 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              11 responses
                              184 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by fernandobr, Today, 09:11 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by timmbbo, Today, 08:59 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by itrader46, Today, 09:04 AM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Working...
                              X