Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SPX Indicator

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

    SPX Indicator

    I want to build an indicator that performs a one-time candle test on all symbols in the S&P 500. One good example is an 'inside day' analyzer that parses through all SPX symbols one by one and checks whether or not today's low was above and the high was below yesterday's candle. If today's candle is an inside day then it gets added to a list which at the end of the loop gets emailed or printed to the console.

    The way I usually would build something like this is to simply add symbols in the initialize method. But I can't possibly do that with 500 symbols. So, is there a way to 'dynamically' load just two candles of a symbol one by one? I am afraid if I build an indicator that loads all those symbols in advance it'll blow my NT memory to pieces.

    If any of this is unclear please let me know.

    #2
    Hi molecool, there would be unfortunately not support method or Add() variation here that you could use for this task. What you can look into though is the Pivots indicator and how it would load an additional series asyncronous for it's calcs on daily data, perhaps this is of use for your project, too.

    Have you already tried using the regular Add() way on a 64 bit machine with time based data (non tick)?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by molecool View Post
      I want to build an indicator that performs a one-time candle test on all symbols in the S&P 500. One good example is an 'inside day' analyzer that parses through all SPX symbols one by one and checks whether or not today's low was above and the high was below yesterday's candle. If today's candle is an inside day then it gets added to a list which at the end of the loop gets emailed or printed to the console.

      The way I usually would build something like this is to simply add symbols in the initialize method. But I can't possibly do that with 500 symbols. So, is there a way to 'dynamically' load just two candles of a symbol one by one? I am afraid if I build an indicator that loads all those symbols in advance it'll blow my NT memory to pieces.

      If any of this is unclear please let me know.
      Reads like something for which the MarketAnalyzer was designed. You would just need to write an indicator that does the comparison, returning an integer, then use a cell color change or row filter to show when the condition is true; dependent on the integer value. Then just load the SPX instrument list into the MarketAnalyzer, and it should do the sorting and filtering for you.

      Comment


        #4
        INTERESTING - but truth be told I have never used the MarketAnalyzer. Can my indicator running in there still spit out an email if it triggers?

        Please point me to the right resource if it's not too much of a bother.

        Comment


          #5
          Hi Molecool,

          Please see here for help setting up filter conditions in the market analyzer:
          http://www.ninjatrader.com/support/h..._and_filte.htm

          One way to do it is to set a plot value of 1 when your condition is true, and 0 otherwise. Then use market analyzer to check columns when your indicator value == 1. To send email, you would just add SendMail() command in the same block that sets your plot as 1.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Yes, I could do that. But let's assume I monitor the entire S&P 500. And 50 of them paint inside candles (just for shags and giggles) - that would produce 50 emails. What I need is ONE email that has 50 symbols in it in this case.

            Comment


              #7
              Anyone?

              I was hoping for some type of input by now...

              Comment


                #8
                Sorry, I'm not sure how you would aggregate the results into one email. You could move all instruments into the same script, but would have to hard code each one in a separate Add() statement.

                It may also be possible with advanced C# coding, to write individual instruments to a file and then send the contents. Maybe consider hiring a NinjaScript consultant to see if they can create for you.
                http://www.ninjatrader.com/partners#...pt-Consultants
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by molecool View Post
                  I was hoping for some type of input by now...
                  Short of coding a multi-series indicator to consolidate all the information into one text block, I doubt that you can do that in NinjaTrader code.

                  The other choice would be to have the indicator append information to an external file, and then have an external program email that file when it changes, or at specific time(s).

                  Comment


                    #10
                    Lol

                    I have only coded Java and C/C++ (and now C#) for 15 years plus. I have an inkling those guys would not be of much help. What you are saying is that your API has no support for that - and yes, of course I'm capable of hacking something up. But what I wanted to know about is a simpler and supported approach.

                    Comment


                      #11
                      Originally posted by koganam View Post
                      Short of coding a multi-series indicator to consolidate all the information into one text block, I doubt that you can do that in NinjaTrader code.

                      The other choice would be to have the indicator append information to an external file, and then have an external program email that file when it changes, or at specific time(s).
                      A productive response - much appreciated! Yes, that's along the lines of what I'm thinking of doing. I could also just update a DB table and then read the result out.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by pilotfo, Today, 12:50 PM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by DTSSTS, Today, 11:35 AM
                      2 responses
                      11 views
                      0 likes
                      Last Post DTSSTS
                      by DTSSTS
                       
                      Started by sinpeople, Today, 07:20 AM
                      2 responses
                      7 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by Frank1000, Today, 03:05 AM
                      5 responses
                      16 views
                      0 likes
                      Last Post Frank1000  
                      Started by fscabrera03, Yesterday, 01:18 PM
                      2 responses
                      25 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Working...
                      X