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

Mass Apply Strategy on Many Stocks At Once

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

    Mass Apply Strategy on Many Stocks At Once

    Hi NT Team,

    Here is what I want to do.

    1) Develop a Strategy
    2) Scan a list of stocks with the desired set up, my scans are based on candles High and Low relative to past 1 or 2 candles (this could be daily candle or lower time frames)
    3) Mass apply strategy on all stocks selected from 2)

    Now my questions are:

    What do you recommend my work flow in this case should be?

    Which tool should I use to scan my stocks?

    If NT doesn't have a tool/feature, is there a way to create a custom (Named after kind of set up) watch list by importing list of stocks?

    Once I have a watch list, is there a way to mass apply a strategy on all the instruments, at once? How? is there a limit?

    Please let me know if you have any question!

    Thanks
    g

    #2
    Hello gbajaj,

    Thank you for the post.

    Strategies specifically cannot be mass applied, you can configure many strategies and then enable them all at once however each individual strategy would need configured on its primary instrument either from the control center or from a chart.

    An alternative would be to make a single multi instrument strategy and hard code the instruments you may possibly trade, for example the strategy may trade 20 total instruments and it could scan all of those instruments to see if any 20 match the criteria to trade. You would need to manually code the 20 instruments into the script.

    The other alternative which would allow you to use instrument lists would be to use the market analyzer. From the analyzer you could use indicators and indicators can also submit orders. You could have the indicator do actions based on the price data for the various market analyzer rows.

    If you can let me know which path you would like to go with I can provide more details on that route.


    You can use the Tools -> Import -> Stock list menu to import a list of stocks into a instrument list.





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

    Comment


      #3
      Thanks for your prompt reply,

      Could you confirm if my understanding is correct:

      I can enable a strategy on my stocks/instruments at once however I have to either attach that to a chart or from control center individually? is that correct? is there a video on how to do that?

      Second alternative sounds very cumbersome, so I would like to understand "market analyzer" approach;
      Can I scan/filter stocks based on price action e.g. inside day candle with month and week both already green? would there be any example for that?

      Thanks
      G

      Last edited by gbajaj; 06-16-2021, 03:46 PM.

      Comment


        #4
        Hello gbajaj,

        Thank you for the post.

        I can enable a strategy on my stocks/instruments at once however I have to either attach that to a chart or from control center individually? is that correct? is there a video on how to do that?
        Yes that is correct, you can see the steps to use a strategy in the following page: https://ninjatrader.com/support/help...ed_strateg.htm

        Can I scan/filter stocks based on price action e.g. inside day candle with month and week both already green? would there be any example for that?
        The market analyzer simply executes the script for each instrument row. Your indciator could check any price conditions that you wanted for each instrument by applying the indicator as a column. The indicator can also have a Plot which it can report a value based on the conditions you made. The market analyzer could see the plot value to filter the analyzer list visually.

        There are some videos covering the market analyzer and indicator use in the following links:

        Use NinjaTrader’s Market Analyzer window to track and analyze 100s of markets in real time! Add entire lists of trading instruments to a market analyzer wind...




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

        Comment


          #5
          Thanks Jesse,

          The market analyzer simply executes the script for each instrument row.
          does this mean that instrument has be listed in the instrument list? Is there a way to run the scan on all the stocks in the market with certain criteria e.g. all 500 stocks of s&p 500 or all stocks with daily volume above 200k and stock price above > $10 much like ThinkOrSwim scanners?

          Comment


            #6
            Hello gbajaj,

            The instrument would need to be added to the analyzer, you can add instruments one at a time or by using lists.

            If you wanted to run a scan over all 500 instruments you would need to add those 500 instruments to the analyzer and then add the indicator column. The indicator would process for each instrument in the analyzer so it could check if any given instrument is over a pre defined criteria.

            Keep in mind that most data providers have limits on the number of concurrent instruments being observed so 500 may be outside of the limit on some providers.

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

            Comment


              #7
              Thanks,

              Looks like we are picking a direction.
              Now, i want to find out how to create this indicator for me: Highlight stocks that had inside bar yesterday. Is there any indicator for that? if not, where can learn to write a script for that?

              Comment


                #8
                Hello gbajaj,

                Thanks for your question.

                There is an Inside Bar indicator on our User App Share, but if you are looking to get a list of stocks that had an inside bar on a previous day, you would would want to modify the indicator so it sets a plot value when an inside bar is found, only on the the day prior to the current day. Then you can apply that indicator to a Market Analyzer Indicator Column, and you can add a Filter Condition to that column to hide the rows depending on a the plot value of the indicator. The result would be the Market Analyzer showing a list of stocks that had an inside bar on a prior day.

                You can consider something like the following to see if the processing bars are on a day prior to the current day:

                Code:
                if (Time[0].Day == DateTime.Now.AddDays(-1).Day)
                Please see below for adding plots and assigning plot values.

                AddPlot - https://ninjatrader.com/support/help...8/?addplot.htm

                The Inside Bar indicator I was referring to can be found below (publicly available link)

                Inside Bar - https://ninjatraderecosystem.com/use...ad/inside-bar/

                Creating Market Analyzer Filter Conditions - https://ninjatrader.com/support/help...lter_condi.htm

                This particular question is not directly related to the original inquiry. In an effort to keep the forum organized so others browsing the forum can easily find helpful information, we encourage you to open a new thread should you have any new inquires.
                JimNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bortz, 11-06-2023, 08:04 AM
                47 responses
                1,611 views
                0 likes
                Last Post aligator  
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                9 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                19 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                6 views
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                22 views
                0 likes
                Last Post Javierw.ok  
                Working...
                X