Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Macd with SMAs

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

    Macd with SMAs

    I would like to create a Macd indicator using SMA lines rather than EMA lines. In other words, I would like to create Raschke's 3/10 oscillator. How do I do that in NT7?

    #2
    Hello jrabil,

    Welcome to the NinjaTrader forums!

    This requires custom programming. The difference between two SMAs can be expressed with:
    SMA(14)[0] - SMA(26)[0]
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Do I create a new indicator under tools/new NinjaScript/indicator? If so, I do not see how to create an indicator that plots the difference between 2 SMAs.

      Comment


        #4
        Yes, you create a new indicator through Tools > New NinjaScript > Indicator.

        You can define inputs for slow and fast periods.

        You can use the snippet below to plot the difference.
        Plot0.Set(SMA(Fast)[0] - SMA(Slow)[0]);

        You can see here for an introduction to indicator development in NinjaTrader.

        Attached is an indicator that does if you want to compare what it should look like.

        To Import
        1. Download the attached file to your desktop
        2. From the Control Center window select the menu File > Utilities > Import NinjaScript
        3. Select the downloaded file
        Attached Files
        Last edited by NinjaTrader_RyanM1; 09-03-2010, 09:49 AM.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          This file gives me an error when I try to import it into Ninja.

          Comment


            #6
            There's not much to the indicator that would cause errors. I see it is .cs instead of the expected .zip file. It's corrected now - please try to download and import again.
            Last edited by NinjaTrader_RyanM1; 09-03-2010, 09:51 AM.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              it says it cannot import the file because it is an invalid file type. it says it must be a zip file.

              Comment


                #8
                I see - thanks for the reply. Please try with the new file added in that same post.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  That works great. Thank you very much.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Mindset, 04-21-2026, 06:46 AM
                  0 responses
                  105 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by M4ndoo, 04-20-2026, 05:21 PM
                  0 responses
                  146 views
                  0 likes
                  Last Post M4ndoo
                  by M4ndoo
                   
                  Started by M4ndoo, 04-19-2026, 05:54 PM
                  0 responses
                  71 views
                  0 likes
                  Last Post M4ndoo
                  by M4ndoo
                   
                  Started by cmoran13, 04-16-2026, 01:02 PM
                  0 responses
                  125 views
                  0 likes
                  Last Post cmoran13  
                  Started by PaulMohn, 04-10-2026, 11:11 AM
                  0 responses
                  79 views
                  0 likes
                  Last Post PaulMohn  
                  Working...
                  X