Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8B6 Ichimoku indicator stops drawing SpanA/B on regular half chart

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

    NT8B6 Ichimoku indicator stops drawing SpanA/B on regular half chart

    Steps:

    As another issue I mentioned earlier in previous thread (http://ninjatrader.com/support/forum...ad.php?t=80327) - but now was able to consistently reproduce.

    1. Add Ichimoku indicator for example on daily chart of MA for 700 days.
    2. Verify all is drawn correctly - Span A and Span B lines start drawing (it is not exactly drawing after 52 bars - much after - but still more or less acceptable).
    3. On chart type "MA" again (or any other instrument) and hit enter
    4. Verify result after step 3 is exactly as in step 2.

    Actual result: now there are more than 200 bars before Span A and Span B are drawn in a regular chart.

    See screenshots attached.

    It works fine in NT7 Ichimoku Indicator - no issues at all.

    Question - can NT8 Ichimoku be implemented in NT8 same way as it was implemented in NT7 using custom plot to avoid any Draw issues currently present in NT8 (Draw.Region, Draw.Line)...

    Thanks
    Attached Files

    #2
    Hello music_p13,

    Thanks for your post.

    We are investigating and will update this thread when we have more information.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      phItchimokuCloud

      HappyPappy has done an excellent job creating the phItchimokuCloud indicator. I really like this indicator and decided to update it to resolve the following:
      1. The first cloud bar was displayed with many skipped bars from the start on some charts.
      2. A cloud trail starting from the bottom of the chart was displayed on some charts.
      3. Added cloud outline colors.
      Note that the changes to the coding are relatively minor.

      Remaining unsolved problem:
      For charts with less data than the display width, the hidden clouds beyond the latest date are sometimes not shown correctly. When the chart is shifted to reveal the hidden clouds, the color of a portion of the clouds is not shown correctly. Upon refreshed by pressing F5, the cloud colors are rectified. This may have been caused by the Draw.Region() function.

      As this is the first time I responded to this post I am not sure if it is appropriate to attach an updated script, which was originally created by others. Please let me know to avoid future violation.
      Attached Files

      Comment


        #4
        Thanks,

        It definitely fixed issues 1 and 3. Didn't notice issue 2 much...

        However, lagging line is missing. If I change color for lagging line from transparent to something else - the price chart would get squeezed to almost zero... So lagging line needs some updates...
        But I do like that the issue 1 was fixed here - was driving me nuts when changing data series length from 10 days to 50 or changing chart type or instrument name - would make regions disappear at the beginning of the chart... I guess just minor fix is needed to fix the lagging line...

        Thanks again

        Comment


          #5
          The TrendLine is actually the Chikou Span (LagLine?), which is displayed with the closing prices shifted back by 26 days (user input). If you assign the TrendLine with a color, it will be shown correctly as the Chikou Span. Thus, all three lines would be shown as per IchimokuCloud.

          As for the LagLine, I do not understand its intended function. From the codes, it seems to be used for establishing the TREND for color coding of the candle sticks. When displayed, as per your comment, the LagLine would cause undesirable effect on the chart.

          Comment


            #6
            Got it.
            However, weird...

            From the code:
            int _trend = Trend;
            TrendLine[0] = _trend;

            //Print(this.Trend);
            //Print(_trend);
            //If 3 bars close below SpanALine[26], then trend change
            if (LagLine[Lag] > SpanALine[BBase] && LagLine[Lag] > SpanBLine[SpanB] && _trend != 1)
            {
            Trend = 1;
            }
            I would assume that TrendLine should plot 0, 1 or -1...
            But it seems that LagLine actually plots 0, -1 or 1 while the TrendLine actually plots what I would call LagLine...

            Yes, if I set TrendLine to be of any color - it behaves as expected. If I set "LagLine" to be of any color - it seems that LagLine becomes 1, 0 or -1 although from the code I would expect the other way around...

            Could be NT bug? I also see some issue in code:

            TrendLine[0] = _trend;

            Although if you look at the TrendLine property - it has getter only (and no setter).

            instead of "TrendLine[0]" = trend we should probably use "Values[4][0]" or add appropriate setter...

            Looks like indicator needs little more work to tweak proper index for plots/series...

            But in any case it is a good start....

            Thanks
            Last edited by music_p13; 12-30-2015, 03:07 PM.

            Comment


              #7
              After further review of the codes, it appears that the problem was caused by the following within the #region properties:
              [Browsable(false)]
              [XmlIgnore]
              public Series<double> LagLine
              {
              get { return Values[4]; }
              }

              [Browsable(false)]
              [XmlIgnore]
              public Series<double> TrendLine
              {
              get { return Values[5]; }
              }

              As shown above, the Values[ ] of LagLine and TrendLine are incorrectly transposed. If you change The LagLine to Values[5] and TrendLine to Values[4], the input LagLine and TrendLine color selections would be correct.
              The TrendLine should not be plotted for normal chart usage, except for checking of the TREND logic.

              Comment


                #8
                Thanks,

                That fixed it...

                By the way, what is the purpose of DailyBase input parameter? What was the intent (since the code behind it is commented out)....

                Will definitely be using this version from now on...

                Comment


                  #9
                  Originally posted by music_p13 View Post
                  Thanks,

                  It definitely fixed issues 1 ...
                  How so? I still see missing cloud for a length of Base.
                  Attached Files

                  Comment


                    #10
                    The Span lines are calculated after the Base length from the start date and the Ichimoku cloud is displayed by shifting the image to the future by the Base length. Thus, the start of the cloud image is painted from 2x Base length from the start date.

                    As the cloud image is painted with offset of Base length to the future, no image would be displayed on the left portion of the screen, equivalent to the Base length. If it is desirable to view this missing cloud, the chart display can be dragged to the right side.

                    Also, there may be some issues with Draw.Region() implemented by NT8, such as wrong colors on clouds painted after the latest date. This can be resolved by pressing F5 to repaint the chart.

                    Comment


                      #11
                      Originally posted by kkc2015 View Post
                      The Span lines are calculated after the Base length from the start date and the Ichimoku cloud is displayed by shifting the image to the future by the Base length. Thus, the start of the cloud image is painted from 2x Base length from the start date.

                      As the cloud image is painted with offset of Base length to the future, no image would be displayed on the left portion of the screen, equivalent to the Base length. If it is desirable to view this missing cloud, the chart display can be dragged to the right side.

                      Also, there may be some issues with Draw.Region() implemented by NT8, such as wrong colors on clouds painted after the latest date. This can be resolved by pressing F5 to repaint the chart.
                      Which means that the issue called out in this line,
                      1. The first cloud bar was displayed with many skipped bars from the start on some charts.
                      still exists, and is apparently not resolved. Either the early part of the cloud is missing or it is not; any putatively correct explanation notwithstanding, unless I must be writing a different kind of English. I was asking how this issue no longer exists, as the writer was claiming.

                      I appreciate your elementary lesson in calculating the Ichimoku lines, but that is not the issue here. I am sure that I already know how to calculate and draw Ichimoku. I have even written an indicator that scans Ichimoku for trading opportunities, and made an NT webinar presentation of it. I was addressing a particular question that has nothing to do with how Ichimoku is calculated: it has to do with how it is presented by your particular implementation in NT8.

                      Whereas, it is only a visual artifact, I was questioning the validity of a particular statement, not asking how to construct Ichimoku.

                      When I ask a question, I prefer to get an answer that is focused on the clear question that I asked, rather than what I see as a strawman issue relating to a peripheral matter, no matter how closely they may seem to be related. If I asked an unclear question, then, of course, getting an irrelevant answer is only to be expected. My question must not have been as clear as I thought, though I still fail to see how so.

                      Comment


                        #12
                        Currently only last 26 bars to the left are not showing up (which is not too bad). In previous versions of Ichimoku there were sometimes cases where it wouldn't show much more than 26 bars (hundreds of bars to the left wouldn't paint etc...) when changing period on tick chart or instrument name and period on daily chart....
                        I wonder how this will behave now in StrategyAnalyzer chart (will be testing soon).

                        The solution to current problem (to display first 26 bars on the left) - is probably to create some custom plot like it was done with NT7 - but no idea if this is supported with NT8 or how to do it.

                        Thanks

                        Comment


                          #13
                          Originally posted by music_p13 View Post
                          Currently only last 26 bars to the left are not showing up (which is not too bad). In previous versions of Ichimoku there were sometimes cases where it wouldn't show much more than 26 bars (hundreds of bars to the left wouldn't paint etc...) when changing period on tick chart or instrument name and period on daily chart....
                          Hundreds? Ah. Now I understand.
                          The solution to current problem (to display first 26 bars on the left) - is probably to create some custom plot like it was done with NT7 - but no idea if this is supported with NT8 or how to do it.

                          Thanks
                          Already done that, but yes.

                          Comment


                            #14
                            music_p13,
                            For the current phIchimoku indicator, the original developer displays the cloud by shifting the image to the future and hence the left portion of the screen is not painted. At this time, I am updating this indicator to display the Ichmoku signals (see attached pdf) and will look at this issue at a later date. Others may have solved this problem already.

                            If you are interested in helping with checking of signal validity and debugging, I will upload the file once completed. At this time, the Ichimoku signals are painted below the low price. My preference is to paint both the arrows and signal codes near the bottom of the chart but I am having trouble obtaining the live ChartPanel.MinValue, which is not being updated when the chart is repositioned with new High/Low prices. I have tried ForceRefresh() but with no success. Any ideas or suggestions would be appreciated.
                            Attached Files

                            Comment


                              #15
                              Sure, would like to help if I can. Feel free to share code so I could review/debug it...

                              As a suggestion - why don't you just draw signals in a new panel? Similar to how Divergence indicator has been coded which is in Indicator section? That way it would always be at the bottom of the chart, no need to do the force refresh etc... Might be more stable as well once tested with StrategyAnalyzer / and then analyzing results...

                              Just my 2 cents...

                              Thanks

                              p.s. sent you a private message...
                              Last edited by music_p13; 01-04-2016, 11:56 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by inanazsocial, Today, 01:15 AM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Jason  
                              Started by rocketman7, Today, 02:12 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post rocketman7  
                              Started by dustydbayer, Today, 01:59 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post dustydbayer  
                              Started by trilliantrader, 04-18-2024, 08:16 AM
                              5 responses
                              23 views
                              0 likes
                              Last Post trilliantrader  
                              Started by Davidtowleii, Today, 12:15 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Davidtowleii  
                              Working...
                              X