Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to apply Indicator/Strategy to one stock being selected from a list of stocks?

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

    How to apply Indicator/Strategy to one stock being selected from a list of stocks?

    Indicator/Strategy can be easily applied to one selected stock through a stock chart. In other words, as long as I already know the stock, I can apply NT8 to use my strategy. What if I need to screen a list of stocks and only apply the Indicator/strategy to the selected stocks, do you have any sample code for stock screening purpose and then apply the strategies? Thanks a lot in advance.

    #2
    Hello localappleseed, thanks for your post.

    Strategies need to be enabled on an instrument by instrument case by the user. In a strategy and indicator, you can add multiple data series to the script using AddDataSeries, this can be used to apply conditions to multiple instruments. See here for a guide on using multi time frame and instrument scripts:

    https://ninjatrader.com/support/help...nstruments.htm

    Another way of doing this would be to make a Market Analyzer Column script that produces a signal, then apply that indicator in the Market Analyzer. When you get the signal from the indicator on one of the rows in the column, apply your strategy to that instrument.
    https://ninjatrader.com/support/help...t_analyzer.htm

    Please let me know if I can assist any further.

    Comment


      #3
      Thank you for the answer.
      AddDataSeries(string instrumentName, BarsPeriod barsPeriod) can add BarPeriod for different Instruments. So this allows one scripts handle different Instruments. But it seems to me this is only applicable to Bars/Charts. How about Level 2 data book? Can I use AddDataSeries to add a different instruments to get its Level 2 Data Book?

      In other words, I can get different BarPeriods for different instruments, can I also get level 2 data book for different instruments?
      Last edited by localappleseed; 08-21-2020, 03:44 PM.

      Comment


        #4
        Hello localappleseed, thanks for your reply.

        Yes, you can. See the first tip on this page:

        https://ninjatrader.com/support/help...arketdepth.htm

        The idea being the OnMarketDepth method will be called in the context of the BarsInProgress index.

        Please let me know if I can assist any further.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        116 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        61 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        40 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        44 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        82 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X