Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SMA Slope Direction Color Indicator Add-On

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

    SMA Slope Direction Color Indicator Add-On

    Looking for a NT8 importable script add-on that enables the user to colorize a single SMA line according to slope direction. I.E., SMA line is green when sloping up and is red when sloping down.

    #2
    Hello Mike3238,

    There is a similar existing script that demonstrates this using the EMA that can be adapted to your needs.

    Below is a public link to the User App Share section of the NinjaTrader Ecosystem.
    This is a conversion of the NT7 indicator EMASlopeColor. Please contact the original author for any questions or comments. Colors the EMA plot when rising or falling.


    This script could be copied and then modified to call the SMA instead of the EMA.

    I am happy to answer any questions you may have about NinjaScript if you decide to code this yourself.

    This thread will remain open for any community members that may know of an existing script that already uses the SMA or would like to make the modifications on your behalf.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.


    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much for your reply to my query Chelsea. I have downloaded into my NT8 the add-on link you forwarded for EMA slope color. However, could you kindly explain how that script file may be modified to call the SMA? Just fyi, I trade with the NT8 Direct Edition, so I do not have advanced Ninja Script options at my disposal.
      Regards, Mike.

      Comment


        #4
        Hello Mike,

        For script development you would need to be using a leased or lifetime license key, or the simulation only license key which allows the NinjaScript Editor to open.


        Please send an email to platformsales [at] ninjatrader [dot] com if you would like to obtain one of these licenses.

        Scripts can be copied in the NInjaScript Edtior. Right-click the script select Save-As, give the script a new name, click OK.

        Change any call to EMA() to SMA(), then compile.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you!

          Comment


            #6
            Hi Chelsea,

            I was able to login with my former Simulation license key. I successfully followed your NinjaScript Editor instructions, up to copying and renaming that script. After that point, I was uncertain how to edit the copied script; i.e. changing any call from EMA() to SMA() and then compiling to transfer the amended script to the indicator drop down list.
            I'm very sorry to complicate the matter, but this was my first attempt at editing a NinjaScript.
            If you have the time and at your convenience, a walk-through reply would be greatly appreciated.
            Thanks.

            Comment


              #7
              Hello Mike3238,

              I took a look at the code and I see that instead of calling the EMA() indicator paul has decided to copy the code logic from the EMA into this indicator.

              On line 57 is the logic for the EMA. The logic itself would need to be changed to the logic of the SMA. (Or it could just be replaced with a call to SMA)

              Alternatively, you could copy the SMA and then add the code from the EMASlopeColor that changes the brushes on lines 60 through 69 to it..
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Ok, thanks. I'll give it a try.

                Comment


                  #9
                  Hello Chelsea,
                  I was also needing the EMASlopeColor Indicator but am unable to download from the link you gave. It just keep spinning but would not download. Is there any other way I can import this into NT8?

                  Comment


                    #10
                    Welcome to the forums Sealed4Life!

                    If you are having issues downloading from the User App Share, please try the follow to troubleshoot downloading issues with your internet browser.

                    1. Clear Browser cache and temporary files
                    2. Use Shift + F5 to refresh the page
                    3. Try a different internet browser

                    Google provides a publicly available resource for clearing browsing cache here - https://support.google.com/accounts/...DDesktop&hl=en

                    If you use a different browser, you can reference that browser's support site for instructions, or use a search engine to find instructions online.

                    We look forward to being of further assistance.
                    JimNinjaTrader Customer Service

                    Comment


                      #11
                      Thanks Jim. I was able to download and import it using a different browser as you suggested.

                      Comment


                        #12
                        Hi Everyone,
                        Does any know how can I change the color of Zigzag indicator to Green & Red? Thanks!

                        Comment


                          #13
                          Hello minhcnn,

                          Welcome to the NinjaTrader forums!

                          There are two approaches

                          1. Create two plots with two different colors and set the plot that has a value, similar to the VolumeUpDown indicator included with NinjaTrader, or the Macrossbuilder available on the User App Share.
                          Rewrite of the MACrossBuilder 1) Various Moving averages: DEMA, EMA, LinReg, HMA, SMA, TEMA, TMA, VWMA, WMA, ZLEMA 2) Various indication options 3) Can output to alerts window 4) Can output to Market Analyzer (+1, 0, ‐1 = Cross up, No cross, cross down) 5) Colors region between Moving averages V1.02 Update 10‐31‐17, minor code […]


                          2. Set the PlotBrushes on the bar to the color you want.



                          The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks for the information Chelsie, How do I collaborate approach #1 to Ninja Trader Chart?

                            Comment


                              #15
                              Hello minhcnn,

                              Below is a link to a forum post with helpful information about getting starting started with NinjaScript and C#.
                              https://ninjatrader.com/support/foru...040#post786040

                              After reviewing the ZigZag indicator I realize this indicator does custom rendering instead of allowing the plot to be normally rendered. Setting different plots like the VolumeUpDown would not be effective, as the rendering is referencing a specific series.

                              Instead of adding an addition plot, you would need to set a brush that can be used for the RenderTarget.DrawGeometry() on line 441.
                              Code:
                              RenderTarget.DrawGeometry(g, [B]Plots[0].BrushDX[/B], Plots[0].Width, Plots[0].StrokeStyle);
                              The logic to set a System.Windows.Media brush can be set in OnBarUpdate(). Then in OnRenderTargetChanged a SharpDX brush can be intialized from this.
                              Below is a link to an example of working with brushes.
                              https://ninjatrader.com/support/foru...606#post789606

                              Also, below is a link to the help guide on rendering. The OnRenderTargetChanged page has example code at the bottom.
                              https://ninjatrader.com/support/help...getchanged.htm
                              https://ninjatrader.com/support/help.../rendering.htm

                              This is more complex than setting two different plots that have different colors based on the same criteria, but is still possible to achieve.

                              If you have not already, you will need to make a copy of the ZigZag. The copy will need to remove the DeviationType enum declaration on lines 453 to 458, as this is already declared in the original ZigZag.
                              https://drive.google.com/file/d/1oVq...ew?usp=sharing

                              As you proceed let me know if you get stuck or need details about any of the tools used for custom rendering.

                              You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.
                              Chelsea B.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post Javierw.ok  
                              Started by timmbbo, Today, 08:59 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post bltdavid  
                              Started by alifarahani, Today, 09:40 AM
                              6 responses
                              41 views
                              0 likes
                              Last Post alifarahani  
                              Working...
                              X