Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Candlestick Indicator - Wrong Colors?

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

    Candlestick Indicator - Wrong Colors?

    Hello,

    with NT8 there seem to be wrong coloring of highlighted bars for Candlestick Pattern Indicator.

    I am used to Green = White and Red = Black but NT 8.0.0.10 has opposite coloring.
    It's very confusing

    Is it possible to set candlestick highlight colors as Green = White and Red = Black logic as it is with NT7?

    Pavel Kloud
    Attached Files

    #2
    Hello pavelkpc,

    Thank you for reporting this behavior with the CandleStickPattern indicator..

    I have reported this to our development and I will have either a bug report tracking ID or feature request tracking ID for you shortly.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello pavelkpc,

      After further review, I have found that the colors for this indicator are chosen based on the background color of the chart.

      If the background is white in either NinjaTrader 8 or NinjaTrader 7, the outline of the bars will be black and foreground will be the colors expected.

      When the background is black in either NinjaTrader 8 or NinjaTrader 7, the colors will be reversed.

      So to get the same colors as NinjaTrader 7, set your theme to the light theme.

      Tools -> Options... -> Skin -> Light

      After changing the skin you will need to restart. After restarting the colors should be as you expect them.
      Last edited by NinjaTrader_ChelseaB; 03-28-2016, 02:42 PM.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hello Chelsea B.,

        thank your for this analysis, you are right - Light skin works correctly.
        I want to use Gray skin as it is much less intense for eyes.

        But I urge you to reconsider such behaviour as candlestick colours should not be theme related - it's hundreds of years old coloring scheme (white / hollow for up and red or black for down).

        Making it an opposite (especially by default as NT8 comes with Gray skin by default) could make a lot of headaches and big losses to traders before they will realize what's wrong.

        If you still plan to stick with such mess, could you, please, give me an advice how to modify this Ninja Trader indicator to work correctly?

        Best regards, Pavel Kloud

        Comment


          #5
          Hello Pavel,

          This indicator was designed the same as it works in NinjaTrader 7 and has not been changed.

          You can choose to make a copy of this indicator and hard code the colors instead of allowing these to be set with conditions.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Oh, I see...
            But still - that does not mean it's a correct behaviour; it's risky at best.

            Could you, please, tell me, how to hardcode colors and where?
            I wasn't working with Ninja Script before.

            I see two lines at the beginning of the Indicator - not sure whether it's enough to change these nor how to change them. They are both set to Brushers.Black so no distinction?

            private Brush downColor = Brushes.Black;
            private Brush upColor = Brushes.Black;

            Comment


              #7
              Hello Pavel,

              When I mentioned that the behavior was the same as NinjaTrader 7, this simply means the script is working as it is intended to work.

              I am happy to submit a feature request on your behalf to remove the functionality of allowing this indicator to be easy to see by changing the colors based on the background color being black. It will be up to our development to decide to implement this or any request, however, we highly appreciate your feedback.

              The code that changes the colors is on lines 53 to 61 in the CandleStickPattern indicator. The downColor is set to the BackColor of the Chart. Below this there is an if statement. If the color of the downColor is black then set the up color to Transparent. Otherwise set the upColor to black.

              Instead of using this if statement, you can create a copy of this script, and in your custom version, set the downColor and upColor to colors of your choosing without any if statement and without any check on the BackColor of the chart.

              You can also contact one of our professional NinjaScript Consultants who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like a list of professional NinjaScript Consultants who would be happy to create or modify any script at your request.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Thank you Chelsea.

                I found it to be actually little bit more complicated as there are also outlines which started to disappear after simple removal of coloring logic so I have reworked this indicator a little and added colors as properties so they could be set for anyones desire + added Bullish Stick Sandwich.

                But when I try to export this indicator there are following problems (forgive translation I see them in my language)...

                line 572: if (!downTrend || MIN(Low, TrendStrength)[0] != Low[0])
                error CS0103: Name MIN does not exist in actual context.

                line 609: if (!upTrend || MAX(High, TrendStrength)[0] != High[0])
                error CS0103: Name MAX does not exist in actual context.

                lines 1089&1090: upTrendStartBarsAgo = Swing(TrendStrength).SwingLowBar(0, upTrendOccurence + 1, CurrentBar);
                error CS0103: Name Swing does not exist in actual context.

                Indicator compiles and works for me and those lines are all part of original Candlestick Pattern Indicator so they should be able to compile and export?

                Edit: One more problem - any pattern on itself works but when more patterns are added to a single chart only few of them are properly colored. Bars are colored per configuration but Outline did not respect set color. Do not understand why.

                My first script so I may be doing something wrong.
                Could you help me to solve those?

                Regards, Pavel Kloud
                Attached Files
                Last edited by pavelkpc; 03-30-2016, 10:22 AM.

                Comment


                  #9
                  Hello pavelkpc,

                  Sometimes you will need to manually add items to your export.

                  Add the @MIN, @MAX, and @Swing indicators to you export. (In the export window from the drop-down select 'System indicators' and for each of these click the checkbox to add them to the export)

                  Regarding the logic, in the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.

                  You can contact one of our professional NinjaScript Consultants who would be eager to create or modify this script at your request or assist you with your script.
                  Please let me know if you would like our business development follow up with you with a list of professional NinjaScript Consultants who would be happy to create this script or any others at your request.

                  But as a tip, this script basically uses upColor, downColor, and textColor for all colors for all objects. As long as you are removing the if statement and hard coding these, I would expect the same behavior no matter what pattern is selected.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Hello Chelsea,

                    regarding export - thanks for the hint; now export works

                    regarding your tip - it's definitely not that easy; I thought so too but there are also outlines whose logic is somewhat hidden

                    regarding logic and up/downColor - I have added 4 parameters up/downColor and up/downColorOutline and coded bar color and outline for every single pattern and it's bar.

                    They work for each single pattern when placed on chart on itself. But with multiple instances of this indicator outline gets overwriten by system default outline color except for one pattern bars without any clear logic which one.

                    Could you direct me to proper forum where I can get help for this?

                    Regards, Pavel
                    Attached Files
                    Last edited by pavelkpc; 03-30-2016, 12:10 PM.

                    Comment


                      #11
                      Hello Pavel,

                      This thread will remain open for any community members that would like to assist you.

                      I would not be able to point you in the direction of another forum, however, a google search for trading forum ninjascript should bring up some results with other forums.
                      https://www.google.com/search?num=10...83.7qCUoFvopJY

                      Regarding your script, the process to track down what is causing the behavior is with prints and by commenting out code to reduce the possibilities of what could be causing the behavior. This is known as debugging.

                      To clarify, the behavior you are experiencing is that if you add the script twice with the exact same settings and same pattern selected, the colors are not the same as if you had only added one instance of the indicator, is this correct?

                      I am testing your script on my end and I am not able to reproduce this behavior.
                      A link to a video of this test is below.
                      http://screencast.com/t/Gkrmls1po5
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Hello Chelsea, I appreciate your help!
                        Idea with screencast is briliant :-)

                        To clarify my problem I have recorded a video:
                        Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


                        Best, Pavel

                        Comment


                          #13
                          Hello Pavel,

                          I found the issue, however, I need to mention that in the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.

                          I'm am letting you know this because I will not be able to debug your scripts in the future. However, my own curiosity led me to debug this for you by adding prints and commenting out code as I have suggested to you.

                          First I removed all other cases other than BearishEngulfing and ThreeBlackCrows. The behavior continued.

                          Next, I commented out the code in BearishEngulfing and the behavior stopped. Then I uncommented that and just commented out the lines that set the bar colors and again the behavior stopped. This means it has to be one of those lines. Now that I can focus on just those 4 lines it was easy to find the error.

                          BarBrush = downColor;

                          You are setting the BarBrush for all bars. To set the color for 1 bar, you must use a bars ago index with BarBrushes.

                          BarBrushes[0] = downColor;

                          Likely there is a similar mistake for the CandleOutlineBrush(es) somewhere in your script.

                          You will need to debug your code to find mistakes as these.

                          Use Prints. Comment out code until the behavior stops to identify the code causing the issue.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Hello Chelsea,

                            thank you for your kind support and help!

                            Unfortunately mentioned problem is not causing outline color loss; and that BarBrush instead of BarBrushes[0] is actually from original NT8 Indicator (both versions and similar for outline were tested).

                            I have done as you suggested and streamlined all code to the degree that there were no color variables left using code like this:

                            BarBrushes[0] = Brushes.Green;
                            CandleOutlineBrushes[0] = Brushes.Green;
                            BarBrushes[1] = Brushes.Red;
                            CandleOutlineBrushes[1] = Brushes.Red;

                            Even this gets overwritten by default outline color (white) when more instances are added. Only one instance (probably last added) kept its outline colors.

                            Problem is only with outline while bar coloring stays as it should; this problem is probably outside the scope of this script and my experience with NT.

                            Attached version works only on dark background as it uses white outline as the default one.
                            Highlighted candles are Green = White while Red = Black as it should be.

                            Please, convey my request to developers as "add an option to set bar color and outline color to highlight up and down bars of detected pattern".

                            Best regards and thanks again.
                            Pavel
                            Attached Files

                            Comment


                              #15
                              Hello Pavel,

                              I am not seeing that you have added any prints or reduced code to try and locate the cause of the issue.

                              Have you attempted to debug the behavior?

                              Are you seeing the same behavior with the original CandleStickPattern indicator that is supplied with NinjaTrader?
                              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