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

Problems creating a high/low scanner

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

    Problems creating a high/low scanner

    Hi there,

    I'm looking to recreate a simple feature I've used on several other platforms but I'm not a programmer so I'm having some trouble.

    I'd like to be alerted when a stock on my instrument list hits a new intraday high, intraday low, 52 week high or 52 week low. What I'm envisioning is an alert box that is constantly scrolling through the stocks on my list as they hit news highs or lows. But maybe a filter would be better for this... I don't know.

    I've read the instructions, but all I can seem to find is how to make alerts based on an indicator crossing a specific level (like CCI over 100, etc), but what I want to do is compare the last price to previous highs and lows.

    Any thoughts on how to proceed here? I'm confused both on how to program criteria as well as how to initiate the scan so that I start receiving the alerts.

    Thanks in advance!

    #2
    There are several methods you can use to determine if the price has reached a new high and will take custom NinjaScript programming to do so. If you're not sure how to start, I'd suggest considering taking one of our courses on Introduction to NinjaScript Development



    If you want to run this scan on multiple stocks, I would suggest creating an indicator to be used in the Market Analyzer and firing the alerts directly through our code.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks for the quick reply. But once I create the code I need to perform the scan, how do I actually use it?

      Last night I created an indicator, based on some code here in the forums, to scan for stocks that have gapped up or down. But I can't seem to figure out what to do with the indicator to make it show as an alert. I tried adding the indicator to "columns" and going through the alert dialogs but all I see are options for "greater than" or equal to, etc. I just want to have ninjatrader find the criteria in my indicator and spit it out into an alert.

      Thoughts on where I'm going wrong? thanks

      Comment


        #4
        You would want to use an Alert function internal to your code:



        Once you have added this to your code, it will be executed on each data series added to your market analyzer.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Matthew View Post
          You would want to use an Alert function internal to your code:



          Once you have added this to your code, it will be executed on each data series added to your market analyzer.
          Thanks, that's obviously what I'm missing. Funny as I didn't see it listed under any of the instructions of dealing with alerts.

          Where exactly do I place this alert code within the code of my indicator?

          Comment


            #6
            You would put this under the condition you're checking for.

            if(myConditon)
            {
            // alert goes here.
            }
            MatthewNinjaTrader Product Management

            Comment


              #7
              Originally posted by NinjaTrader_Matthew View Post
              You would put this under the condition you're checking for.

              if(myConditon)
              {
              // alert goes here.
              }
              Thanks.

              Just so I have this straight... Once I have my indicator compiled with the alert code inserted, it will just start working automatically? Do I have to load the indicator in market analyzer first? My code simply looks for if the current price is above or below the previous days close. How do I know if the alert is activated or not?

              Thanks again for the help, but I wish this information was somewhere easily accessible. I know you can't help with the programing, but are there step by step instructions on what to actually do with the indicator once you've created it? I'm sure what I'm asking is very simple to accomplish, but I can't seem to find the correct instructions to help me. I understand how to set alert and cell conditions as per the instructions, I'm talking about using a custom indicator.

              thanks again

              Comment


                #8
                You need to add the indicator to the Indicator column of the market analyzer and it should work as per your indicator code.

                It would be the same procedure as outlined in our Adding Columns section or our help guide:



                As long as the conditions evaulte as true, the alert should be triggered in real-time.
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Originally posted by NinjaTrader_Matthew View Post
                  You need to add the indicator to the Indicator column of the market analyzer and it should work as per your indicator code.

                  It would be the same procedure as outlined in our Adding Columns section or our help guide:



                  As long as the conditions evaulte as true, the alert should be triggered in real-time.
                  Ok, it's getting clearer so thanks for bearing with me.

                  If I understand correctly, any custom indicator I create MUST be loaded in a column of market analyzer in order for alerts to be triggered? If so, do I need to alter the alert cell conditions drop down menu under "columns" or does the indicator itself take care of that?

                  Also, is there a place to see all alerts NT7 is currently set to scan for?

                  Comment


                    #10
                    Hello,

                    No you wouldn't need to make any additional alerts since your code is doing that for you.

                    There is no place to see where all alerts are currently set to scan for
                    MatthewNinjaTrader Product Management

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Jimmyk, 01-26-2018, 05:19 AM
                    6 responses
                    834 views
                    0 likes
                    Last Post emuns
                    by emuns
                     
                    Started by jxs_xrj, 01-12-2020, 09:49 AM
                    6 responses
                    3,290 views
                    1 like
                    Last Post jgualdronc  
                    Started by Touch-Ups, Today, 10:36 AM
                    0 responses
                    9 views
                    0 likes
                    Last Post Touch-Ups  
                    Started by geddyisodin, 04-25-2024, 05:20 AM
                    11 responses
                    62 views
                    0 likes
                    Last Post halgo_boulder  
                    Started by Option Whisperer, Today, 09:55 AM
                    0 responses
                    8 views
                    0 likes
                    Last Post Option Whisperer  
                    Working...
                    X