• 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.


No announcement yet.

Partner 728x90


Horizontal Divergence line

  • Filter
  • Time
  • Show
Clear All
new posts

    Horizontal Divergence line

    I'm looking for an indicator that draws a horizontal line at divergence. Not the typical slanted line that u see all the time that connects the high to the higher high & vis versa.

    I want just a line drawn horizontal at the pivot that created the divergence until the next divergence line is made. Like the swing indicator but only when there's a divergence.

    Any idea's out there? P.S. The arrows not included
    Attached Files
    Last edited by trdninstyle; 05-17-2020, 01:30 PM.

    Hello trdninstyle,

    This post is in the Indicator Development section of the forums.

    Are you developing this script yourself and wanting assistance with the code?

    To draw a historical line use Draw.HorizontalLine().

    Are these plot values you are calling from a custom indcator?

    Or are you looking for one you can download and import?
    Chelsea B.NinjaTrader Customer Service


      Hi Chelsea B,

      I'm looking for one I can download and import.

      I chose to place this post in the indicator development section because I cant find a div indicator that plots only horizontally maybe someone will give it a go? Who knows.

      All of the divergence indicators out there only draw slanted lines at price not horizontal lines from the pivot like the example that I drew in myself in order to show what I'm talking about.

      I would love to develope a script myself to do this function but I have no clue on how to start? I definitely would need assistance with the code or some kind of detailed video.

      A prior divergence line is very important as price proceeds it & depending on some others things going on it's a weaker situation to take advantage of or to wait. Right now I draw them in myself so I dont overlook those area's but I dont always spot them on time.

      Divergences also happen in lessor degrees that are vital for instance on a MacD the macd could retrace 100% yet price retraces 40% so now u have a 60% divergence or macd retraces 62% and price retraces 50% now u have 12% divergence. The % is not important but the div lines from previous area's are so to have them print & go out until the next one is made is important.

      So your saying that I may be able to develope a script to do this? Thankyou.

      Last edited by trdninstyle; 05-18-2020, 07:16 AM.


        Hello trdninstyle,

        I'm not personally aware of an existing indicator with the exact logic you have described, however this thread will remain open for any community members that may know of this indicator and would like to provide a link.

        Below I am providing a link to a forum post with helpful information about getting started with NinjaScript.

        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.
        Chelsea B.NinjaTrader Customer Service


          That is very helpful information thankyou I will go thru that information and sure you can have a professional Ninja Trader Consultant contact me so I can get prices for what I want.

          I want some other things too, like the color background to be more exact I'm using a free version it's not perfect and I want a multiple fib calculation that changes color when price closes above/below by 2 ticks and there's other stuff too but I'm getting carried away now. lol

          By the way if ANYONE wants to develop anything like this for free please do and share



            Hello Bill,

            This is Chris following up on behalf of Chelsea.

            You can search our list of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more:You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

            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 companies and services 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.

            Let me know if I may be of further assistance.
            Christopher D.NinjaTrader Customer Service


              Good thankyou very much I have plenty to go by now. You guys have a good day!


                I'm back. I've been reading up and slowly starting to get it, it's not as intimidating as I thought it was but still not easy. Building my own indicator. I've built a few now but it's in the 'coding' where I have more to learn but I'm getting the concept.

                My indicators do nothing there just trial runs I didn't know how to tell them what I wanted. I need to remove them? 'Tools' > 'Remove NinjaScriptAssembly' and in that box there was a few indicators I did remove but I can't get into my actual 'Indicator Assembly' area to remove more of them. Do I use the 'Export" > 'Ninjascript add on ? To get into my Indicator Assembly? (To remove what I earlier added on).

                Also is there a good video on demonstrating painting the chart background on a SMA Crossover? Actually a 'trigger line' crossing another 'trigger line' is what I'm after. Any of you guy's good at coding where you can log unto my computer and help me?


                  Hello trdninstyle,

                  To remove open source indicators:
                  • Click New -> NinjaScript Editor -> select to expand the Indicator folder
                  • Right-click the indicator by name -> select Remove
                  To remove an open source strategy:
                  • Click New -> NinjaScript Editor -> select to expand the Strategies folder
                  • Right-click the strategy by name -> select Remove
                  To remove a third party assembly package please:
                  • Click Tools -> Remove NinjaScript Assembly...
                  • Select the assembly to remove -> click the Remove button

                  To export a NinjaTrader 8 NinjaScript, so this can be shared and imported by a recipient, do the following:
                  1. Click Tools -> Export -> NinjaScript...
                  2. Click the 'add' link -> check the box(es) for the script(s) you want to include
                  3. Click the 'Export' button
                  4. Enter a unique name for the file in the value for 'File name:'
                  5. Choose a save location -> click Save
                  6. Click OK to clear the export location message
                  By default your exported file will be in the following location:
                  • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
                  Below is a link to the help guide on Exporting NinjaScripts.

                  While the Strategy Builder 301 video demonstrates how to setup crossover conditions with the SMA, it does not set an action to Drawing > Set background color.
                  I'm not aware of any videos that demonstrate clicking add in the 'Do the following', opening the Drawing list, and selecting Set background color.
                  But I highly encourage you to give it a try.

                  This thread will remain open for any community members that would like to offer to connect to your computer to directly assist you with learning programming.
                  Keep in mind that there are professional consultants that provide educational services and teach programming in the NinjaTrader Ecosystem.

                  The NinjaTrader Platform Support / NinjaScript Support can be reached at platformsupport [at] ninjatrader [com]. Our support does not provide one on one educational services but are able to answer any direct questions you have.
                  Chelsea B.NinjaTrader Customer Service


                    Thank you for your reply I found it very helpful and deleting some of my indicators worked well. Also the video about >
                    Strategy Builder 301 video demonstrates how to setup crossover conditions with the SMA< is very good. When is the next live event for the Strategy Builder 301 / crossover conditions SMA ?

                    I use to have a anaSlopeSMA that colored the background can't find it anymore I believe I retrieved it from the old User App Share. I liked the older one better.
                    Last edited by trdninstyle; 05-21-2020, 06:26 PM.


                      Under 'Conditions and Actions' there is 'Paint the background' but this is for using a strategy but I imagine it will also allow the user to paint background building a Indicator using 'Conditions and Actions' ? 'Set the background color'
                      Attached Files
                      Last edited by trdninstyle; 05-21-2020, 06:43 PM.


                        Hello trdninstyle,

                        Thanks for your replies.

                        Here is a link to all platform training webinars. https://ninjatrader.com/PlatformTraining The Strategy Builder 301 is presented every other Thursday at 4:00 PM EST.

                        Yes, you can create an indicator and you can paint the background. There is no Strategy builder like interface for indicators and you would have to work directly in Ninjascript.

                        You could create the functionality in the Strategy Builder and run it as a strategy that does not place trades but only indicates if you wish.
                        Paul H.NinjaTrader Customer Service


                          Hello Paul H,

                          I was thinking that too, that last line u wrote. If I created a function as a strategy to paint background green or red on a trigger line crossover but have no trade trigger involved it does seem like that could work. Am I correct is that what you are also saying? I just built my own simple crossover strategy today in order to begin learning it.

                          I have a question with that though, if a strategy is running (even if it doesn't prompt trades) would I be deactivating the strategy with my manual trading? Or is there a override function for that? So I can keep on manually trading and having the strategy continue to run? Can I have more than one strategy running at same time?

                          Because if so, (I think I saw that I can?) is it feasible to have a function to plot a line every time there is a 100% extension? As a strategy but without the trading aspect in it. I would plot a yellow dotted line going across to the right. I have the concepts just need to get good at writing everything and figuring out the limitations.

                          Thank you so much!


                            Hello Bill,

                            Yes, you could run the strategy without placing trades and just color the background. Strategies do have to be enabled and this could be cumbersome.

                            Indicators, which do not have to be enabled, would require manually adding the logic and do not have the same sort of builder. However, it is possible to generate the code using the Strategy Builder and then copy and paste this into an indicator as long as there are no order methods being used. The NinjaScript Editor 401 demonstrates how to copy code out of a script made by a builder into a second unlocked script.

                            If there is a position open to the instrument and account the strategy is enabled on, clicking the Close button specifically will disable the strategy. Exiting the position with an order (such as placing a sell market order to exit a long position) will not cause the strategy to become disabled.
                            Chelsea B.NinjaTrader Customer Service


                              I did see that from a vender I followed along but I keep getting errors. It's a pretty nice trick I liked it. I'm going to have to keep working at it. I Googled NinjaScript Editor 401 going to explore more video's do whatever it takes.

                              Thanks, do u have a direct link to said video to this task? To save me time looking at wrong videos until I find right one. One more question, what is the monthly cost to lease?


                              Latest Posts


                              Topics Statistics Last Post
                              Started by Cimxrice, Today, 01:25 AM
                              0 responses
                              1 view
                              Last Post Cimxrice  
                              Started by Z-Starter, Today, 01:21 AM
                              0 responses
                              1 view
                              Last Post Z-Starter  
                              Started by atman, Today, 12:37 AM
                              0 responses
                              Last Post atman
                              by atman
                              Started by random9570, Yesterday, 09:01 PM
                              1 response
                              Last Post Fulcanelli  
                              Started by natngk, Yesterday, 08:28 PM
                              1 response
                              Last Post NinjaTrader_Marco