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

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.

    JimNinjaTrader Customer Service

    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.
        JimNinjaTrader Customer Service

        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.
            JimNinjaTrader Customer Service

            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.
                JimNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by geddyisodin, Today, 05:20 AM
                3 responses
                20 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by lorem, Today, 09:18 AM
                1 response
                4 views
                0 likes
                Last Post lorem
                by lorem
                 
                Started by bmartz, Today, 09:30 AM
                0 responses
                3 views
                0 likes
                Last Post bmartz
                by bmartz
                 
                Started by GussJ, 03-04-2020, 03:11 PM
                14 responses
                3,245 views
                0 likes
                Last Post GussJ
                by GussJ
                 
                Started by ArkansasClint, Today, 09:28 AM
                0 responses
                0 views
                0 likes
                Last Post ArkansasClint  
                Working...
                X