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

About OHLC and OHL indicator alerts

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

    #16
    Hello ラリー,

    there are symbols that do not sound an alert even though the conditions are met.
    Had they been met previously? You have on condition reversed selected, if the condition was already met before then it won't alert a second time, it would need the opposite condition to become true to re arm the alert.

    The common denominator of those symbols that did not sound seemed to be when the market gapped up (when the opening price of the day achieved the previous day's high) after the close.
    You mentioned after the close, if the close of the session happened then alerts will not fire until the following day when the next session opens. Bars close when the first tick of the next bar is received. On a end of session bar that will happen at the beginning of the following session.

    JesseNinjaTrader Customer Service

    Comment


      #17
      Thank you for your reply.

      Had they been met previously? You have on condition reversed selected, if the condition was already met before then it won't alert a second time, it would need the opposite condition to become true to re arm the alert.
      Reloading NinjaScript or manually activating alerts before or even during the start of a market will trigger an alert for all symbols when the condition is met, but in the automatic case, if the condition is met during the start of a market, some symbols will alert again and some will not.

      It may be better to send you a video of a demonstration during the opening of the market to better inform you.
      We will send the video on Tuesday because the Japanese market will be closed for a three-day weekend.
      Thank you for your understanding.​
      Last edited by ラリー; 10-07-2022, 04:38 PM.

      Comment


        #18
        Hello ラリー,

        Reloading NinjaScript or manually activating alerts before or even during the start of a market will trigger an alert for all symbols
        When you reload NinjaScript that will reprocess the historical bars again. If your conditions become true during those bars it would cause an alert or do the action that you programmed. During the start of the market you now have new bars which can be processed and may additionally cause alerts depending on what conditions you made. If you want to find out why the script is working like it is you would need to use Prints to debug your code to know why.

        It may be better to send you a video of a demonstration during the opening of the market to better inform you.
        ​That would really only let me see what is happening but I would not be able to provide a specific set of directions on how to fix the conditions. If the condition is becoming true before it should or at the wrong time or not at all you would need to use Prints to identify what is causing that to happen in those specific use cases.

        JesseNinjaTrader Customer Service

        Comment


          #19
          Thank you for your reply.

          When you reload NinjaScript that will reprocess the historical bars again. If your conditions become true during those bars it would cause an alert or do the action that you programmed. During the start of the market you now have new bars which can be processed and may additionally cause alerts depending on what conditions you made. If you want to find out why the script is working like it is you would need to use Prints to debug your code to know why.
          In that case, both OHL and OHLC Script prints would be required, correct?

          That would really only let me see what is happening but I would not be able to provide a specific set of directions on how to fix the conditions. If the condition is becoming true before it should or at the wrong time or not at all you would need to use Prints to identify what is causing that to happen in those specific use cases.

          I understood.

          I'm sorry if my explanation took up your time, so I just wanted to send you a video.

          I would appreciate it if you could confirm it.​​​

          Comment


            #20
            Hello ラリー,

            In that case, both OHL and OHLC Script prints would be required, correct?

            Yes you would need to print whatever is being used in the conditions for the alert to see what values are observed. You can do that for any of the areas you see it working or not to better understand if the conditions you made are having some trouble or are not accounting for all use cases that you needed.

            JesseNinjaTrader Customer Service

            Comment


              #21
              Thank you for your reply.

              I understand.

              I will do it in conjunction with the video and send it to you today.
              Thank you very much.​

              Comment


                #22
                We have taken a video to check the operation and are sending it to you.
                It is a little long, but we would appreciate it if you could check it when you have time.

                ​In this video, Reload was performed before the market started, and the high price of the day (October 7) was compared with the high price of the previous day (October 6), and alert logs (symbols 2721, 6928, etc.) were output. However, the alert log was not output and the alert was not sounded even though these were renewing the previous day's high (Oct. 7) today (Oct. 11).
                I would like to output these logs and sound the alerts, so I am contacting you this time.​

                We have also printed the document in print, and I am attaching a screenshot of the text and the print statement in NinjaScript.

                Thank you in advance.​

                Attached Files

                Comment


                  #23
                  Hello ラリー,

                  Unfortunately the video is not helpful for me to understand what may be happening. Have you tried to reduce the number of instruments you used so that you can output the details for just an instrument which is not having the alert?

                  Because you are not using NinjaScript to submit the alert you would have to address why the condition for the alert is not becoming true in the tool which uses the indicators. If the action of reloading the script is where you see the problem that would be the best place to experiment to find out why. You can also try using the playback connection to diagnose the problem so you don't have to wait for a specific time of day to test.

                  If the condition for the alert is becoming true in historical data that would be why the alert is not appearing, alerts only appear in the log during Realtime bars, it would otherwise be silently ignored.

                  An alternative would be to use the NinjaScript alert function rather than trying to configure alerts in the user interface, that would be a better way to ensure the alerts are happening by physically programming the conditions for the alerts. You can then debug that use case using prints if you do that.



                  JesseNinjaTrader Customer Service

                  Comment


                    #24
                    Thank you for your reply.

                    Unfortunately the video is not helpful for me to understand what may be happening. Have you tried to reduce the number of instruments you used so that you can output the details for just an instrument which is not having the alert?​
                    Thank you for your reply.

                    No, I would like to do so, but it may be difficult because the situation may change depending on the movements of individual stocks after the opening of trading on the day, such as alerts.

                    However, as a common point that the alert does not sound, I think there is a chart image in the latest screenshot, but 2721 and 6928 continue to update the previous day's high price.
                    Also, I think that 9271 and 6550 have updated the previous day's high only on the day.

                    And in the case of 9271, the opening price of the day updated the high price of the previous day, but an alert sounds here.
                    This means that the alert will not sound if the previous day's high price is updated for more than 2 days in a row and it is updated at the open price.​

                    Because you are not using NinjaScript to submit the alert you would have to address why the condition for the alert is not becoming true in the tool which uses the indicators. If the action of reloading the script is where you see the problem that would be the best place to experiment to find out why. You can also try using the playback connection to diagnose the problem so you don't have to wait for a specific time of day to test.
                    I mentioned earlier that there are symbols (2721, 6928) that don't sound alerts, but they do sound alerts when you reload.
                    But I want them to ring when the conditions are met in real time.
                    As an addendum to the above.

                    An alternative would be to use the NinjaScript alert function rather than trying to configure alerts in the user interface, that would be a better way to ensure the alerts are happening by physically programming the conditions for the alerts. You can then debug that use case using prints if you do that.
                    Please provide a sample code if possible.​

                    Comment


                      #25
                      Hello ラリー,

                      You can find a sample of creating an alert in the help guide link that I had posted. You can call Alert() from a condition in NinjaScript. That would let you debug that use case in more detail because you are making the conditions for the alert in the code directly. If something is not working right you can then use Print statements to output the values and make sure the condition is becoming true in realtime. This also makes sure the re arm type is not at fault because the alert is being submitted by the script rather than the user interface.
                      JesseNinjaTrader Customer Service

                      Comment


                        #26
                        Thank you for your reply.

                        I will try the sample code, but I would like to add it to the market analyzer, in that case, when I create a new NinjaScript, do I select New indicator or New market analyzer?

                        Comment


                          #27
                          Hello ラリー,

                          You can still use the market analyzer for that use case. You would still use an indicator, but you would create your own indicator with alerts programmed into it.
                          JesseNinjaTrader Customer Service

                          Comment


                            #28
                            Thank you for your reply.

                            I tried to select a new indicator and add the sample code to the market analyzer, but only the dots (...) on the side are displayed and nothing else is displayed. Can you do it?
                            Attached Files

                            Comment


                              #29
                              Hello ラリー,

                              You are not plotting a value so it should only show ...

                              To have a value show up you would need to add a plot and plot a value.
                              JesseNinjaTrader Customer Service

                              Comment


                                #30
                                Thank you for your reply.

                                I added a plot, but the values are not showing as well.
                                What did I do wrong in adding the plot?​
                                Attached Files

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by GussJ, 03-04-2020, 03:11 PM
                                15 responses
                                3,270 views
                                0 likes
                                Last Post xiinteractive  
                                Started by Tim-c, Today, 02:10 PM
                                1 response
                                8 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by Taddypole, Today, 02:47 PM
                                0 responses
                                2 views
                                0 likes
                                Last Post Taddypole  
                                Started by chbruno, 04-24-2024, 04:10 PM
                                4 responses
                                51 views
                                0 likes
                                Last Post chbruno
                                by chbruno
                                 
                                Started by TraderG23, 12-08-2023, 07:56 AM
                                10 responses
                                403 views
                                1 like
                                Last Post beobast
                                by beobast
                                 
                                Working...
                                X