• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Analyzer - List gaps

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

    Market Analyzer - List gaps

    I would like to have a column in the Market Analyzer that shows if an instrument opens with a gap. I have no experience coding especially for the Market Analyzer, so any advice would be be appreciated.

    I tried making a simple indicator that would plot a line and that I could use the value of that line in the Market Analyzer, but I can't get it to work.

    This is the calculation:

    GapLine[0] = (Open[0]-Close[1])/(Close[1])*100;

    It should show a percentage value of the gap, positive or negative depending of the direction of the gap.

    #2
    Hello chrille,

    Thank you for writing in.

    To make values calculated in your indicator available for display in the market analyzer column, you should reference the SMA indicator preloaded on NinjaTrader. This demonstrates setting a calculated value to a plot, which the MA can reference.

    To add a column to market analyzer which will display this value, right click on the market analyzer window>columns>then click Add and select your indicator.

    See our Helpguide on How to Add columns:
    NT8: http://ninjatrader.com/support/helpG...th_columns.htm

    I set up an indicator with a plot and set the value to the plot to 1 if there is a gap, 0 if no gap. So within the MA window you’ll see this and can set up alerts accordingly. Note: I defined a gap as an open above or below the previous bars high/low, so you would want to modify the code for what you’re looking for. See attached.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      NinjaTrader_AlanP,

      Thank you for you help! I know how to create simple indicators that plots a value or creates a "spike" in the plot if the criteria are met, and how to utilize that in the Market Analyzer. That's about as far as my Ninjascript skills goes as of now.

      Turns out that with the gap-indicator, I was very close having it work. I had missed to add "if (CurrentBar < x) return;". After I added that the plot showed up.

      Thanks again!

      Comment


        #4
        One last thing. I would like to control the output in he Market Analyzer to two decimals and add a '%' sign. Any easy way to do that?

        Comment


          #5
          Hello chrille,

          I have attached an indicator which will limit the output when displayed in the market analyzer window to only 2 decimals. It will also add a % symbol on the front of the output.

          Please let us know if you need further assistance.
          Attached Files
          Alan P.NinjaTrader Customer Service

          Comment


            #6
            Thank you, works perfectly. Modified it a bit to have the % symbol behind the output!

            Excellent!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by priceisking, Today, 12:51 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by chartish, Today, 10:33 AM
            3 responses
            16 views
            0 likes
            Last Post chartish  
            Started by casabella, Today, 11:51 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by Johnny, Today, 11:42 AM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Jermaine  
            Started by habibalex, Today, 09:03 AM
            2 responses
            13 views
            0 likes
            Last Post sledge
            by sledge
             
            Working...
            X