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

How do I determine if a bar closes at the top 25% of the bars range?

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

    #31
    Originally posted by Volcom View Post
    Sandman...THANK YOU!!

    I simply just changed the variable up and down color code to private instead of public and that did the trick! No additional coding required. You're the man! Thanks to everyone else as well for helping out.
    If you had said that you want the colors hard-coded and not capable of being changed from the PropertyGrid, that is the answer that you would have been given.

    You asked how to persist the chosen colors (impliedly changed from the PropertyGrid). You got the answer to the question that you asked.

    Comment


      #32
      koganam, I'm afraid you lost me. All I know is that every time I logged into NT, this indicator would not save the up and down colors. It kept defaulting to Red for down and blank for up, none in which I chose. It was a pain to constantly have to change this for multiple symbols daily. Not sure if I could have explained in any more detail. Thanks to Sandman, this is now fixed.

      Comment


        #33
        Originally posted by Volcom View Post
        koganam, I'm afraid you lost me. All I know is that every time I logged into NT, this indicator would not save the up and down colors. It kept defaulting to Red for down and blank for up, none in which I chose. It was a pain to constantly have to change this for multiple symbols daily. Not sure if I could have explained in any more detail. Thanks to Sandman, this is now fixed.
        1. How were you changing the colors before now?
        2. Can you still change the colors using that method? (i.e., without editing the file itself?

        That is what we mean by hard-coding the colors.

        Comment


          #34
          1) I was changing the colors in the indicator itself and when that didn't work, I tried changing them in the code with the same result.

          2) The only way I can change the colors now is through the code and not the indicator. That option has now been removed since I changed the coding from public to private which I am fine with since this seemed to be the only thing that worked.

          Comment


            #35
            Originally posted by Volcom View Post
            1) I was changing the colors in the indicator itself and when that didn't work, I tried changing them in the code with the same result.

            2) The only way I can change the colors now is through the code and not the indicator. That option has now been removed since I changed the coding from public to private which I am fine with since this seemed to be the only thing that worked.
            Well, then you were not lost after all?

            You have just repeated what I said. Your values are hard-coded and cannot be changed from the PropertyGrid.

            Appropos of nothing, making the property private is meaningless and redundant, because the colors have already been declared as private in the backing store when they were first created (in the "Variables" section). But, no matter. There are always many ways to write code, so as long as you like your results, that is all that matters.

            Comment


              #36
              Originally posted by koganam View Post
              Well, then you were not lost after all?

              You have just repeated what I said. Your values are hard-coded and cannot be changed from the PropertyGrid.

              Appropos of nothing, making the property private is meaningless and redundant, because the colors have already been declared as private in the backing store when they were first created (in the "Variables" section). But, no matter. There are always many ways to write code, so as long as you like your results, that is all that matters.
              Okay cool, that totally makes sense to me now on what was going on with this code and why it was doing what it was doing. Thanks! 👍🏼

              Comment


                #37
                volcom. Glad it worked out.

                Your indicator colors the candlesticks in Panel1 but also opens a second panel. Don't know whether that is intentional on your part or not. Or if you fixed it already. If not, it's easy to fix. Go into your Code, under the section "Variables" and under the sub-section "protected override void Initialize()" add this line:

                {
                Overlay = true;
                }

                That will cause your indicator to then not open up in a second panel.

                Currently your indicator defaults to calculate on BarClose=True. If you want to change that to False, add this line in the same section just underneath Overlay:

                CalculateOnBarClose = false;

                That will cause the candlestick bar to be colored while the bar is still in progress.

                sandman

                Comment


                  #38
                  Good eye Sandman! I always wondered why there was an empty second panel on the bottom. I input your code and had it removed. Thanks again!! :-)

                  Comment


                    #39
                    Originally posted by Darth_Trader View Post
                    I hope it's what you are wanting.

                    All it does it color the bars that close at the X top of the range or X bottom of the range (adjustable).

                    And you can choose the color of the up and down bars.

                    Hope you like it.

                    - D
                    Do you know if the Colored Scalp Bar indicator is available for NT8?

                    Comment


                      #40
                      Candle % indicator

                      Hi Darth... hoping you're still on this forum. I've been looking for an indicator that will show the close of candel within the top or bttom 25% of a candle and came across your thread with the aaScalpBar.cs zip download. Sadly I'm not a coder
                      Did you perhaps make an MT4 indicator from this?
                      Would so love to have one...

                      Starfishy
                      Cape Town
                      South Africa

                      Comment


                        #41
                        for MT4

                        i'm sorry, i don't have MT4 at all. Is it downloadable/free? I'd write it for you.

                        I didn't realize I had so many problems with my original code. Reading through the list here makes me aware of them.

                        I've not picked it up in a while but will at least fix this and post it again once I test it out.

                        I'm not sure if NT made their own version for NT8 or not. I wrote this, hoping it would be a useful tool for coders to add onto with other bar drawing indicators. Does NT8 use the same coding language/protocol?

                        I wrote another I called the 'slither stop' which moves your stop loss to the bottom of "x-range bar'...so if its set to 5, the stop will be set to the lowest low of the last 5 bars. As each new bar is printed, if there is now a higher, lowest low, it will move the stop up to that level.
                        Last edited by Darth_Trader; 04-06-2018, 02:35 AM.

                        Comment


                          #42
                          Hola,
                          Llevo tiempo buscando un indicador como este para NT8, alguien sabe si existe.

                          Saludos,
                          Tirso

                          Comment


                            #43
                            Hello Terso,

                            Thank you for your post.

                            While ordinarily we don't convert indicators for clients, this was a very simple conversion for NinjaTrader 8 that I have completed as a courtesy. It can be found on our User App Share via this publicly available link:

                            This is a conversion of the NT7 Colored Scalp Bar indicator from this forum thread: https://ninjatrader.com/support/forum/forum/ninjatrader-7/indicator-development-aa/75862-how-do-i-determine-if-a-bar-closes-at-the-top-25-of-the-bars-range



                            Here is a basic guideline of how to import NinjaScript add-ons in NinjaTrader 8:

                            Note — To import NinjaScripts you will need the original .zip file.

                            To Import:
                            1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
                            2. From the Control Center window select the menu Tools > Import > NinjaScript Add-on...
                            3. Select the downloaded .zip file
                            4. NinjaTrader will then confirm if the import has been successful.

                            Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

                            Once installed, you may add the indicator to a chart by:
                            • Right click your chart > Indicators... > Select the Indicator from the 'Available' list on the left > Add > OK

                            Please let me know if I can be of further assistance.

                            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.

                            Kate W.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by jeronymite, 04-12-2024, 04:26 PM
                            2 responses
                            28 views
                            0 likes
                            Last Post NinjaTrader_BrandonH  
                            Started by Mindset, 05-06-2023, 09:03 PM
                            10 responses
                            262 views
                            0 likes
                            Last Post NinjaTrader_BrandonH  
                            Started by michi08, 10-05-2018, 09:31 AM
                            5 responses
                            741 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Started by The_Sec, Today, 02:29 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post The_Sec
                            by The_Sec
                             
                            Started by tsantospinto, 04-12-2024, 07:04 PM
                            4 responses
                            62 views
                            0 likes
                            Last Post aligator  
                            Working...
                            X