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

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 rjbtrade1, 11-30-2023, 04:38 PM
          2 responses
          75 views
          0 likes
          Last Post DavidHP
          by DavidHP
           
          Started by Stanfillirenfro, Today, 07:23 AM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by FitSpressoHonest, Today, 09:14 AM
          0 responses
          4 views
          0 likes
          Last Post FitSpressoHonest  
          Started by Davide999, 05-18-2023, 03:55 AM
          4 responses
          557 views
          1 like
          Last Post kcwasher  
          Started by rexsole, Today, 08:39 AM
          2 responses
          8 views
          0 likes
          Last Post NinjaTrader_Erick  
          Working...
          X