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

Random Alerts

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

    Random Alerts

    Hello,


    I'm new to the Ninjascript editor and just trying it out.

    I hope you can help me. I try to recognize a candlestick pattern with the program and give me a signal back.
    Unfortunately, the problem with this is that it also gives me signals even though the conditions are not met at all.
    The Indicator should just test the newest 3 Bars and ignore the others.

    I hope you can help me.

    Thanks.
    Last edited by Vracupie; 07-06-2021, 12:46 PM.

    #2
    Hello Vracupie,

    From the image I couldn't really tell what the problem is in contrast to the description. Have you tried using some Prints to output what values you are using in the condition? If the condition is true that would indicate the values matched what you are checking for, if that is not correct you may need to adjust what you are checking for.



    I look forward to being of further assistance.


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

    Comment


      #3
      Thank you for your fast answer. I fixed the random alerts and switched my programm to an Strategy, but the Programm stopps if it get one Signal. How can i Write that the Programm will Check the if‘s everytime there is a new bar (and gives everytime the signal not only once)? Thank you guys.

      Comment


        #4
        Hello Vracupie,

        Thank you for your reply.

        Jesse is out of the office today, but I'm glad to help - could you provide a sample of your current code? If we can see what you're trying, we can give you some guidance.

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Hello,

          first of all thanks for your fast answer!

          I fixed that my Indicator gave me Random Alerts and switched to an strategy.

          I still have the Problem, that my Indicator just check all the if's till he found one Signal.
          But after he gave me one Alert the Programm stops and will check no more bars.

          I have one more Question, how can i decide, that the Indicator only check the last 3 Bars?

          Thank you a lot!

          Comment


            #6
            Hello Vracupie,

            Thank you for your reply.

            We would need a sample of your code that's triggering the alerts in order to discern why it may only be alerting once.

            What kind of condition are you wanting to just check the last 3 bars for? Crossover conditions (CrossAbove() and CrossBelow() have a lookback period, meaning they will check that number of bars to see whether a series crossed a particular price level or other series.




            The more detail you can provide about what you're currently trying and what the intended behavior is, the more accurate assistance we can provide.

            Thanks in advance; I look forward to assisting you further.

            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Thank you for your reply.

              I added my Script, i hope you can help me.

              The Programm works, but only once. If i get an alert the script stops working and i have to restart the script.

              Maybe the script should make a return after the alert is coming out.

              Thank you a lot!
              Attached Files

              Comment


                #8
                Hello Vracupie,

                Thank you for your reply.

                In my testing I'm getting multiple alerts as I let the script run, they just aren't very often. I've been running this since about 7 am Mountain time and I've gotten just 2 alerts. I also note you have a typo in the first alert's file path - you have a space between the A and L in "Alert1.wav".

                Thanks in advance; I look forward to assisting you further.
                Kate W.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by SightCareAubetter, Today, 12:55 PM
                0 responses
                2 views
                0 likes
                Last Post SightCareAubetter  
                Started by traderqz, Today, 12:06 AM
                8 responses
                15 views
                0 likes
                Last Post traderqz  
                Started by SightCareAubetter, Today, 12:50 PM
                0 responses
                1 view
                0 likes
                Last Post SightCareAubetter  
                Started by Mongo, Today, 11:05 AM
                4 responses
                14 views
                0 likes
                Last Post Mongo
                by Mongo
                 
                Started by Skifree, Today, 03:41 AM
                5 responses
                13 views
                0 likes
                Last Post Skifree
                by Skifree
                 
                Working...
                X