Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market analyzer for the crossover of the MACD lines

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

    Market analyzer for the crossover of the MACD lines

    Hello,
    I would like to configure the market analyzer e.g. for the crossover of the MACD lines. After entering columns-conditions-properties I can set only a constant value. So I thought maybe it is possible in the strategy buider. Unfortunately, when I set the conditions for the MACD line crossover, I don't see the actions display option in the market analyzer widnow.
    How should i configure it ?

    #2
    Hello t3chn0,

    Thanks for your post.

    We moved your question to the Indicator Development forum since you would need to make an indicator to make this work.

    You could certainly use the Strategy Builder to create NinjaScript syntax for a adding a MACD indicator and making a Crossover condition with that indicator, but in order to use it in the Market Analyzer, you would need to make an indicator that assigns the result of the crossover to a plot.

    For example, if there is a crossover, assign a value of 1 to your plot. If there is no crossover, assign a value of 0.

    Please see the information below for creating plots and assigning values. I'm also linking our indicator tutorials which can help give direction for creating custom indicators.

    AddPlot documentation (Shows adding plots and assigning values to plots) - https://ninjatrader.com/support/help...t8/addplot.htm

    Indicator tutorials - https://ninjatrader.com/support/help...indicators.htm

    We look forward to assisting.

    Comment


      #3
      Hello Jim,
      thank you for the fast reply.
      I hoped I can do everything inside strategy builder :P
      Correct me if I am wrong, at first i need make an indicator in NinjaScript Editor and add to Market Analyzer ?
      Do you have any video tutorial ?

      Comment


        #4
        Hello t3chn0,

        Most of the work can be done in the Strategy Builder. (Adding the indicator, making the crossover condition)

        After creating that logic with the Strategy Builder, you can click View Code to see the resulting syntax. Compare this with the resulting code when you click View Code on a new strategy that does not have anything added to it. This will show what logic you have to implement in an indicator and where.

        New indicators can be made in the NinjaScript Editor by right clicking on the Indicators folder and clicking New Indicator. You can add a plot from the New indicator wizard which can also remove a coding step.

        Now that an indicator template is made, you can copy the logic from the strategy to the indicator.

        All that would be left is assigning the indicator plot a value of 0 when there is no cross, and to set a value of 1/2 when there is a cross.

        We do not have any video tutorials for indicator development, but our NinjaScript Editor 401 video covers unlocking strategies and working with unlocked code in the NinjaScript Editor. I have included a link below if that video helps.

        NinjaScript Editor 401 (publicly available recording) - https://www.youtube.com/watch?v=O5-C8GyV9OI

        Otherwise, I strongly advise going through the first few indicator tutorials and reference the AddPlot documentation to see how to assign values to plots.
        Last edited by NinjaTrader_Jim; 11-18-2021, 11:53 AM.

        Comment


          #5
          Hello,
          I need further help to show Macd line crossover in the Market Analyzer.
          MACD crossover strategy is working, the code is checked.
          I started create a new indicator in the Ninjascript editor, Input Parameters are the same as the MACD strategy.
          Should I set up Plot and Lines for 0 when there is no cross with colour translarent and 1 for cross Long green and 2 Short red ?
          In Market Amalyzer under columns/ conditions/ cell what should i set up to display crossover ?
          Thank you in advance for your help
          Attached Files

          Comment


            #6
            Hello t3chn0,

            You can accomplish your goal by adding 1 plot in the New Indicator wizard.

            In the indicator's code, you can add a plot and set it to 0 at the top of the indicator's OnBarUpdate method.

            Then you can add the crossover conditions.

            If there is a CrossAbove, you can then set the plot to 1

            If there is a CrossBelow, you can then set the plot to 2.

            Then you can add the indicator to the Market Analyzer, and set up cell conditions that change the color to one that reflects "no cross" when the plot is 0, a color that reflects "cross above" when the plot is 1, and a color that reflects "cross below" when the plot is 2.

            Comment


              #7
              Thank you for the fast reply.
              Correct me if I am wrong, In "Plot and Lines should I set 1 (see attachment)?
              What about Name, plot style and color ?

              Attached Files

              Comment


                #8
                Hello t3chn0,

                These would all be up to you. They are just properties to name and decorate the plot if were to put the indicator on a chart.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                636 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                366 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                107 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                568 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                571 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X