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

up and donw colors on indicators and ma's

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

    #16
    Hello marcus2300,

    The colors would change if the plots for the indicator change. With some data providers, what gets created with realtime data may not be the same as what is fetched as historical data. This could result in different plot values forming after reloading the indicator.



    However, this is just a guess at what you are seeing. I would need clarification on how to recreate what you are seeing to comment further, because I do not see these symptoms.

    If this is a matter of simply pressing F5 to reload the indicator after certain bar formations, we could better see what you are referring to after creating those bars with Market Replay and the Playback Connection. If can recreate what you see as ill behavior, we could look into why that is and see about making changes to improve.

    So far as I have tested when playing through Market Replay data for yesterday and today on MES 03-22, I have not seen plots that are red and then turn green after pressing F5 with this indicator.

    Please let me know how I can reproduce that symptom with Playback, and I will be better able to answer your question.
    JimNinjaTrader Customer Service

    Comment


      #17
      Hi Jim,

      I will do the following:
      • I will see when it happens in realtime trading (ninjatrader kontinuum datafeed).
      • I will make screenshot and write down the exact time when it happens
      • I will use Playback to see if the problem occurs there too
      • I will comeback and send you all information I could collect
      I don't see how it can be because of the datafeed. I see it in realtim trading, so ninjatrader kontinuum datafeed. If I just push F5, I suppose the data is not changed, only the script is executed again. So it would run with exactly the same data.
      The fact that exceptionally it happens that a bar has the two colors, so red and green at the same time. That is impossible I think, so there is somewhere something wrong.
      It always happens in a big move opposite direction which should cause a fast change of color.

      I will come back as soon as I have proof of the problem. Might take a few days/weeks...

      PS: what should I use as data for marketreplay? I use normally historical data...
      Last edited by marcus2300; 12-14-2021, 01:35 PM.

      Comment


        #18
        Hello marcus2300,

        If you can point out the symptom with Market Replay data downloaded from our servers (Control Center > Tools > Historical Data > Load) we could test the same data. We would just need to know the data series settings used to create the chart, indicator settings, when to start and stop playback and when to reload (Timezones will be relevant) so we can recreate the behavior and comment on it.
        JimNinjaTrader Customer Service

        Comment


          #19
          Hi Jim,

          I cannot reproduce the error in Market replay. But I have seen the problem again today and have made screenshots to proof it.

          The MACD up and down has 4 parameters:
          1. MacdU : GREEN bar
          2. MacdD : RED bar
          3. Avg : WHITE line
          4. Diff : WHITE bar

          Diff WHITE bar is the difference between :
          • Value GREEN bar and WHITE line from Avg if bar is GREEN
          • Value RED bar and WHITE line from Avg if bar is RED

          So if Diff is positive, the color of the bar has always to be GREEN.
          So if Diff is negative, the color of the bar has always to be RED.
          The video shows clearly that this is not always the case on the chart. So there is a problem.

          Photo 1:
          Bar is RED at 10 AM (chicago time)
          Diff is positive, so it means that MACD is bigger than Avg. So the bar should be GREEN.

          Avg + Diff = MacdU (-6,74+0.103= -6,637)
          So that bar is wrong. It should be GREEN at the close. But it is RED.

          Photo 2:
          Bar is RED at 11 AM (chicago time)
          Diff is negative, so it means that MACD is smaller than Avg. So the bar should be RED.
          Avg - Diff = MacdD (-6,88-0,538= -7,418)
          So that bar is correct. It should be RED at the close and it is.

          Photo 3:
          I took photo 1 again and pushed F5.
          The bar changed color and became GREEN. Now the bar is correct. If I would not push F5, the bar would stay RED, which is wrong and it will never become GREEN.

          I filmed that period and saw many times that the color was wrong. The video is 530Mb big so I cannot send him.

          I am sure that there is some kind of problem.

          I added the three photos as well as the properties of the indicator.
          Click image for larger version  Name:	photo1.jpg Views:	0 Size:	356.0 KB ID:	1181797
          Click image for larger version  Name:	photo 2.jpg Views:	0 Size:	328.3 KB ID:	1181798
          Click image for larger version  Name:	photo 3.jpg Views:	0 Size:	347.3 KB ID:	1181799
          Click image for larger version  Name:	properties.jpg Views:	0 Size:	45.2 KB ID:	1181800
          Last edited by marcus2300; 12-15-2021, 11:39 AM.

          Comment


            #20
            Hello marcus2300,

            I am not sure we are looking at the same indicator. Your databox is showing multiple plots for MACD, when some times there is a plot value and sometimes there is not.

            I have been testing the User App Share submission below:

            https://ninjatraderecosystem.com/use...macd-updown-2/

            The link above is publicly available.

            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.


            Which will only colorize the main MACD plot if the current plot value is greater than the last value or less than the last value.

            Below is the logic that checks if the main MACD line is rising or falling. It only colors one plot and there is not case for both the conditions to be true at once. So the issue of seeing "two colors at once" may be due to the specific version of the indicator you are using.

            Code:
             // Plots MACD color when rising or falling
            if (IsRising(MACD(Fast, Slow, Smooth)))
            {
                PlotBrushes[0][0] = Uptick;
            }
            else if (IsFalling(MACD(Fast, Slow, Smooth)))
            {
                PlotBrushes[0][0] = Downtick;
            }
            I also do not see cases where the plot is incorrectly colored. To check that, you would use the data box look at the current and pervious plot values for the same plot. (if the indicator uses two plots to show different colors this would not work the same.) If the current plot value is greater than the previous, IsRising() is true, and the bar gets colored. The bar gets colored once and even if it did set PlotBrushes again, the color would be overwritten and there would not be a "two colors at once case."


            JimNinjaTrader Customer Service

            Comment


              #21
              This is the one I use:https://ninjatraderecosystem.com/use...acd-avgupdown/

              I see now that the rules are slighty different.
              Last edited by marcus2300; 12-15-2021, 07:08 PM.

              Comment


                #22
                Originally posted by NinjaTrader_Jim View Post
                Hello marcus2300,

                I am not sure we are looking at the same indicator. Your databox is showing multiple plots for MACD, when some times there is a plot value and sometimes there is not.

                I have been testing the User App Share submission below:

                https://ninjatraderecosystem.com/use...macd-updown-2/

                The link above is publicly available.

                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.


                Which will only colorize the main MACD plot if the current plot value is greater than the last value or less than the last value.

                Below is the logic that checks if the main MACD line is rising or falling. It only colors one plot and there is not case for both the conditions to be true at once. So the issue of seeing "two colors at once" may be due to the specific version of the indicator you are using.

                Code:
                 // Plots MACD color when rising or falling
                if (IsRising(MACD(Fast, Slow, Smooth)))
                {
                PlotBrushes[0][0] = Uptick;
                }
                else if (IsFalling(MACD(Fast, Slow, Smooth)))
                {
                PlotBrushes[0][0] = Downtick;
                }
                I also do not see cases where the plot is incorrectly colored. To check that, you would use the data box look at the current and pervious plot values for the same plot. (if the indicator uses two plots to show different colors this would not work the same.) If the current plot value is greater than the previous, IsRising() is true, and the bar gets colored. The bar gets colored once and even if it did set PlotBrushes again, the color would be overwritten and there would not be a "two colors at once case."

                Hi Jim,
                thanks for reply. My understanding is this MACD up-down indicator changes the color of plot line based on difference between current value and one bar prior, right?
                Is there an indicator that changes the color of price bar on the main panel instead of plot line?

                Comment


                  #23
                  Hello judysamnt7,

                  You are welcome to check the User App Share for free indicators. Mentioning if there is a specific indicator that changes chart bar colors based on MACD colors may be a bit tricky since it is a pretty specific behavior.

                  If you wanted to modify the MACD Up Down indicator I linked so it colors the main chart bars instead of the MACD line, you can download the indicator I linked and you can replace the usage of PlotBrushes with BarBrushes

                  BarBrushes - https://ninjatrader.com/support/help...barbrushes.htm

                  Since this thread is originally for NinjaTrader 7, please direct any NinjaTrader 8 questions to new threads in the proper NinjaTrader 8 forums. (This helps to keep the forum organized and so users browsing can easily find answers to their questions.)
                  JimNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by fx.practic, 10-15-2013, 12:53 AM
                  5 responses
                  5,404 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by Shai Samuel, 07-02-2022, 02:46 PM
                  4 responses
                  95 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by DJ888, Yesterday, 10:57 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by MacDad, 02-25-2024, 11:48 PM
                  7 responses
                  159 views
                  0 likes
                  Last Post loganjarosz123  
                  Started by Belfortbucks, Yesterday, 09:29 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post Belfortbucks  
                  Working...
                  X