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

Identifying Swings

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

    #16
    Thanks Ed,
    The triangle is not important to my project so I won't worry about triangle size.

    However it is interesting to note out that dorschden has made available larger (even much larger) triangles for swings in his PriceActionSwingPro Program. (Under Plots at the bottom of his user entry dialog.)

    Pete

    Comment


      #17
      Need some more help here:

      Can you see any reason that this sound alert does not work: soundOn is true in the dialog window.

      if(soundOn == true)Alert("myAlert", NinjaTrader.Cbi.Priority.High,
      "Reached threshold",@"C:\OilShort.wav", 0, Color.Black, Color.Yellow);

      It does not work addressing the wave file in the Ninja sound folder either.

      Thanks

      Comment


        #18
        Hello,

        Have you checked the value of soundOn via a print in your code, right before the alert is called? That would let you know if something is setting it to false somehow, even though you set it to true in the Strategies window.

        Also, please try just using "OilShort.wav" in your call to Alert(), with the .wav file being in the proper sounds folder (I assume it already is). Do you see a difference after that?
        Dave I.NinjaTrader Product Management

        Comment


          #19
          Originally posted by Pete77 View Post
          Need some more help here:

          Can you see any reason that this sound alert does not work: soundOn is true in the dialog window.

          if(soundOn == true)Alert("myAlert", NinjaTrader.Cbi.Priority.High,
          "Reached threshold",@"C:\OilShort.wav", 0, Color.Black, Color.Yellow);

          It does not work addressing the wave file in the Ninja sound folder either.

          Thanks
          Alerts are always a bit tricky.

          Firstly, a trivial point: all you need for a bool is either:

          if(soundOn) // true

          or

          if(!soundOn) // false

          This is from an ind of mine:

          if( AudioAlertOn )
          Alert("DownAlert", Priority.High, "DownAlert", "Alert4.wav", 0, Color.White, Color.Black);


          I think the case is that either the sound file is in the 'Sounds' folder, in which case all you need is the full file name or the full Windows address of the file, something like

          C:\Users\Fred\Documents\ ... etc

          I would guess that your address:

          @"C:\OilShort.wav"

          would be incorrect.

          Pete, I'm not an 'alerts' expert. If you need information from the experts, the best thing would be to start a new thread and one of the brilliant Ninja staffers will help you.

          Cheers.

          Comment


            #20
            Thanks, I will take that advice and try it in real time tomorrow.

            Comment


              #21
              This is mysterious,still does not work. I removed the soundOn condition.

              The OliLong.wav file is in the Ninja sound folder.

              Here is a code snippet: The DrawlLne works but the Alert not.

              DrawLine("Tag2",true,swingLow1Index,swingLow1Val,s wingLow2Index,swingLow2Val,
              Color.White,DashStyle.Solid,3);

              Alert("myAlert", Priority.High,"DownAlert","OilShort.wav", 0, Color.White, Color.Black);


              I guess I had better start a new thread as you suggest.

              Comment


                #22
                Originally posted by Pete77 View Post
                This is mysterious,still does not work. I removed the soundOn condition.

                The OliLong.wav file is in the Ninja sound folder.

                Here is a code snippet: The DrawlLne works but the Alert not.

                DrawLine("Tag2",true,swingLow1Index,swingLow1Val,s wingLow2Index,swingLow2Val,
                Color.White,DashStyle.Solid,3);

                Alert("myAlert", Priority.High,"DownAlert","OilShort.wav", 0, Color.White, Color.Black);


                I guess I had better start a new thread as you suggest.
                Pete - is there a file in your Ninja Sounds folder with the name: "OilShort"?

                Also, if you need the alert to sound more than once, you may need to reset it using "ResetAlert".

                Comment


                  #23
                  Hi

                  Yes, both wav files are in the Ninja sounds folder

                  I want to hear the alert each time there is a setup, for example each time my code draws a line( which is part of my alert for the setup).

                  I was able to get the audio alert using PlaySound() but of course it tried to play with every tick. Rather than trying to fix that I thought it would be simpler to use Alert().

                  The is tough to fix since neither one uses playback for testing.

                  Comment


                    #24
                    It just occurred to me, your mentioning Reset, I will look into that because I did hear an audio alert early this morning.

                    Pete

                    Comment


                      #25
                      Originally posted by Pete77 View Post
                      It just occurred to me, your mentioning Reset, I will look into that because I did hear an audio alert early this morning.

                      Pete
                      Pete - this is how I've set up one of my alerts:

                      Alert("Alert_Name", Priority.High, "Alert_Name", "File_Name.wav", 0, Color.White, Color.Black);
                      ResetAlert("Alert_Name");
                      Yea - Alert is more sophisticated than PlaySound.

                      Comment


                        #26
                        Hi Ed,

                        Getting some action now from your last suggestion!

                        But its sounding on every tick. Any ideas on that?

                        Pete

                        Comment


                          #27
                          Current:

                          DrawTriangleDown("Tag1",true,swingHigh1Index,swing High1Val,
                          Color.Red);

                          DrawLine("Tag4",true,swingHigh1Index,swingHigh1Val ,swingHigh2Index,swingHigh2Val,
                          Color.White,DashStyle.Solid,3);

                          if(soundOn)Alert("myAlertL", Priority.High,"UpAlert","OilLong.wav", 0, Color.White, Color.Black);

                          ResetAlert("myAlertL");

                          Comment


                            #28
                            Originally posted by Pete77 View Post
                            Hi Ed,

                            Getting some action now from your last suggestion!

                            But its sounding on every tick. Any ideas on that?

                            Pete
                            Nice to hear from you again, Pete.

                            Obviously, you're working with CoBC = false. I haven't really worked with that much. I'm basically a 'true' man!

                            Maybe you could use FirstTickOfBar so it'll only reset then as if the strategy were CoBC = true just for that, as in:

                            if(FirstTickOfBar)

                            {...}

                            Please don't hesitate to start a new thread if you'd like to widen the pool of ideas: also the great Ninja staffers could offer some ideas.

                            Comment


                              #29
                              Hello,

                              If you using the value of soundOn to determine when to sound the alert, then you will need to switch soundOn to false when you would like to halt the alerts. Am I correct in assuming that all of the code in your last post is within a condition? If so, then as long as that condition is true and soundOn is also true, the alert will trigger on every OnBarUpdate().
                              Dave I.NinjaTrader Product Management

                              Comment


                                #30
                                Thanks guys, I started a new thread "Audio Alert Problem"

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by trilliantrader, 04-18-2024, 08:16 AM
                                4 responses
                                15 views
                                0 likes
                                Last Post trilliantrader  
                                Started by mgco4you, Today, 09:46 PM
                                1 response
                                4 views
                                0 likes
                                Last Post NinjaTrader_Manfred  
                                Started by wzgy0920, Today, 09:53 PM
                                0 responses
                                4 views
                                0 likes
                                Last Post wzgy0920  
                                Started by Rapine Heihei, Today, 08:19 PM
                                1 response
                                8 views
                                0 likes
                                Last Post NinjaTrader_Manfred  
                                Started by Rapine Heihei, Today, 08:25 PM
                                0 responses
                                6 views
                                0 likes
                                Last Post Rapine Heihei  
                                Working...
                                X