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

How come a simple volume[0] > 20000 doesnt work?

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

    How come a simple volume[0] > 20000 doesnt work?

    Here is my script, i want to draw diamond when the volume is higher than 20K

    if (Volume[0] >= 20000)
    DrawDiamond("Volume Spike" + CurrentBar, 0, Low[0] - TickSize, Color.Red);

    As the picture show, it plots when there is under 20K in the overnight and regular session. What is wrong with the statement if (Volume[0] >= 20000)? Do i need to add something in front of the 20000? Please help. Thank you

    #2
    Here is the picture
    Attached Files

    Comment


      #3
      You will have to debug.

      Try something like:

      if (Volume[0] >= 20000)
      {
      Print(Time[0].ToString() + " " + Volume[0]);
      DrawDiamond("Volume Spike" + CurrentBar, 0, Low[0] - TickSize, Color.Red);
      }

      and take a look at the output window to see what is happening.
      RayNinjaTrader Customer Service

      Comment


        #4
        What do u mean output window? I typed your statement and i click the output window, it is blank. What should i do?

        Also, if i want a sound alert, do i replace the
        DrawDiamond("Volume Spike" + CurrentBar, 0, Low[0] - TickSize, Color.Red);
        with
        PlaySound("Alert1.wav");
        ?

        Comment


          #5
          Open the output window (Tools > Ouput window) then apply your indicator on a chart, you will see statements that shows the bar time and volume. You should NOT see a statement where volume is less than 20,000. Correct on the alert.
          RayNinjaTrader Customer Service

          Comment


            #6
            Ok. Thanks a lot. It works

            Comment


              #7
              am i using the wrong volume indicator ... for the volume spike to work ....??? (i'm using the "buysell volume top" indicator on a 1min chart ..... & the volume spike ... does not alert me.....

              thx

              Comment


                #8
                The previous comments and code were valid for the normal VOL indicator, please check with this one.

                The BuySellVolume from our Power Volume indicators would only work in realtime going forward -

                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Bertrand....

                  thanks for the response.... loaded the buysellvolume indicator as advised..... still no luck with the alerts .... i looked at the code, and could not find anywhere in there ... where the code tells it to play an audio alert when conditions are met......

                  thx...

                  Comment


                    #10
                    my mistake ..... i'm referring to the volume spike indicator not giving me alerts ...

                    thx

                    Comment


                      #11
                      I'm sorry not sure I follow you here - which indicator did you load now? Were you adding the custom code change to it to provide the alerts? If yes, please post the code you used so we can take a look.

                      Thanks
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        what i'm looking for is ..... an indicator that measures the increase in volume (percentage wise on the current bar being printed) ... to the previous closed volume bar. with an audio alert ....

                        thanks...

                        t

                        Comment


                          #13
                          You would need to custom code this as per the previous posts here in the thread - an intro into indicator coding can reviewed here -



                          As a start you can check the Volume Bar Color MA shared here - http://www.ninjatrader.com/support/f...1&pp=15&page=4
                          BertrandNinjaTrader Customer Service

                          Comment


                            #14
                            ok .... thanks....

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by rocketman7, Today, 01:00 AM
                            0 responses
                            1 view
                            0 likes
                            Last Post rocketman7  
                            Started by wzgy0920, 04-20-2024, 06:09 PM
                            2 responses
                            27 views
                            0 likes
                            Last Post wzgy0920  
                            Started by wzgy0920, 02-22-2024, 01:11 AM
                            5 responses
                            32 views
                            0 likes
                            Last Post wzgy0920  
                            Started by wzgy0920, 04-23-2024, 09:53 PM
                            2 responses
                            74 views
                            0 likes
                            Last Post wzgy0920  
                            Started by Kensonprib, 04-28-2021, 10:11 AM
                            5 responses
                            193 views
                            0 likes
                            Last Post Hasadafa  
                            Working...
                            X