Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to use Market Analyzer as a scanner

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

    How to use Market Analyzer as a scanner

    Hi,

    I'm sure this question was asked before, but I couldn't find a relevant thread by search.

    I have an indicator very similar to OpenIsClose example in Ninja help. When a certain condition is satisfied, it returns 1 and draws a bar in the indicator area. When I insert this indicator into a column in Market Analyzer, all I see is the LastClose of the stock price.

    How can I see the result of the indicator for the last bar in a column, like 1 or 0, so that I can filter the list and use it as a market scanner that will only list the stocks that satisfy the indicator's condition? I only want to see the stocks

    Many thanks,

    Nick.

    #2
    Hello Nick,

    Thank you for your post.

    Market analyzer can display plots from indicators. What may be happening is the default Plot0.Set(Close[0]) may be somewhere in your indicator. If you have an additional plot added to this indicator, you can select it from the Plot selection.

    If this isn't what you're seeing, share the code for the indicator you're trying to view in the Market Analyzer.

    Once you get it to display the 1 or 0 you're looking for, you can see this help guide article for how to setup the filter.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan.

      I was assigning "1" to plot0 when the condition was satisfied, but not "0" when it is not satisfied, assuming default value would be zero. I added a line to assign 0. Now it works. Thanks again for quick response.

      Comment


        #4
        I have a similar problem.

        I am writing a custom indicator to be used in Market Analyzer. But I can't get any data other than [0]. Here is an example code:

        if ( SMA(50)[0] > SMA(50)[20] )
        {
        Plot0.Set(1);
        } else {
        Plot0.Set(0);
        }

        In code above, SMA(50)[0] work fine, but SMA(50)[20] is causing the following error:
        "Error on calling 'OnBarUpdate' method for indicator 'TrendDetector' on bar 0: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart."

        I added :

        if (CurrentBar < 50); return;

        at the beginning of the code, but then code exits right there and never processes the rest.

        What I need is very simple as the code implies: I want indicator to plot 1, if SMA(50) value of today is larger than SMA(50) value 20 days ago.

        This is on a daily stock data.

        Any help is appreciated.

        Nick.

        Comment


          #5
          Hi 10percent,

          I believe we resolved this in another forum thread, let's continue from there.
          TimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Renejm, Today, 06:17 AM
          0 responses
          3 views
          0 likes
          Last Post Renejm
          by Renejm
           
          Started by kazisl, Yesterday, 06:41 PM
          2 responses
          10 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by impactX, 05-04-2021, 01:07 AM
          1 response
          7 views
          0 likes
          Last Post Lancer
          by Lancer
           
          Started by op1031, Yesterday, 05:51 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by aaadetos, 05-04-2021, 09:28 AM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_Heath  
          Working...
          X