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 Mongo, Today, 11:05 AM
          4 responses
          14 views
          0 likes
          Last Post Mongo
          by Mongo
           
          Started by traderqz, Today, 12:06 AM
          7 responses
          13 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Skifree, Today, 03:41 AM
          5 responses
          13 views
          0 likes
          Last Post Skifree
          by Skifree
           
          Started by traderqz, Yesterday, 09:06 AM
          5 responses
          34 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by guillembm, Today, 11:25 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X