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

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:


          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.
                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 sidlercom80, 10-28-2023, 08:49 AM
                      168 responses
                      2,261 views
                      0 likes
                      Last Post sidlercom80  
                      Started by Barry Milan, Yesterday, 10:35 PM
                      3 responses
                      10 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by WeyldFalcon, 12-10-2020, 06:48 PM
                      14 responses
                      1,428 views
                      0 likes
                      Last Post Handclap0241  
                      Started by DJ888, 04-16-2024, 06:09 PM
                      2 responses
                      9 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by jeronymite, 04-12-2024, 04:26 PM
                      3 responses
                      41 views
                      0 likes
                      Last Post jeronymite  
                      Working...
                      X