No announcement yet.

Partner 728x90


Ichimoku Kinko Yuo

  • Filter
  • Time
  • Show
Clear All
new posts

    Ichimoku Kinko Yuo

    As an ilustration of what I did, using region colouring (please see I built what must be my first or second NT indicator - the Ichimoku Kinko Yuo (please see for details).

    Because the indicator is not that simple, and I could not get code samples anywhere, I hope that my interpretation is correct.
    Feedback is very much appreciated.

    This indicator deserves some attention, because, from what I read, this is all you need to make trading decisions.
    You just need the right conditions/tests.

    Thanks and have fun with it,

    Attached Files

    Nice work JC, thanks for sharing.


      The name Ichimoku Kinko Hyo translates to "Equilibrium chart at a glance"

      Looks interesting.

      In trying to figure out what an Inchmoku was all about, I googled some of the names found in the indicator, and found the following definitions: tenkan-sen, kijun-sen, chikou-span, senkou-span-A, senkou-span-B.

      The full description in the article referred to by JC is much more complete, however.
      Last edited by KBJ; 10-30-2007, 08:44 AM. Reason: Add title


        Commented and cleaned up the code. I think you'll find it much easier to understand.
        Attached Files
        Last edited by KBJ; 10-31-2007, 06:35 AM. Reason: Updated sources with fix to ChikouSpan plot


          Thanks KBJ,
          I don't think I'm any good at C#/NT, really.
          But I do get lots of fun trying!



            I may have a slight advantage with 30+ programming experience in other languages, so don't feel bad.

            What you did worked and that is a good first step.


              Hi JC,

              Just been having a look at this indicator and reading the website you suggest which is very informative. It looks to me though that your Chikou-span line is sitting 26 bars after the price, where it should be sitting 26 bars before the price.


                Thanks to both JC and KBJ for posting this indicator - it is intriguing.

                In an attempt to better understand its application I have been googling away and as a result I have a couple of questions.

                1. In every definition I have found for Chikou Span it is described as the current closing price shifterd backwards 26 periods. However as best I can see from the indicator as presented it plots the close from 26 periods ago for the current bar, which seems to be a very different look. So my question is, which is correct?

                2. In a similiar vein the Senkou Span A & B are shifted forward 26 periods and in the charts shown in the link below are shown appearing 'in front' of price. So - question 2 is - Is that how the indicator is actually implemented?




                  rt-trader, yimbot,

                  you are very likely correct.

                  I'll review the implementation of this indicator.
                  As I said in my original post, this indicator is a bit less trivial than your average indicator, so.... thanks for pointing that out for me.

                  After this what I intend to do is, of course, build a profitable fully "automated" strategy around it, and post it here, of course, although the KumoTrader website does not seem to agree that this is possible. But, without trying.....




                    I am getting an error when importing your version of the Ichimoku ("Import failed. There are NinjaScript files in the imported NinjaScript Archive File that have programming errors. These errors must be resolved before you can import the NinjaScript Archive File.")
                    Any idea why this is happening?

                    rt-trader, yimbot, and all others following this thread,

                    it does seem that my code is not correct, exactly because of what you said. It's easy to fix the ChikouSpan - using my old code (and until I can use KBJ's version) you should have something like
                    cs = Close[0]; <- new line
                    if (CurrentBar >= Period2 )
                    ks = ( MAX(High,Period2)[0] + MIN(Low,Period2)[0] ) / 2;
                    ks = Median[0];

                    and further down... instead of
                    it should be
                    if (CurrentBar >= Period2 )

                    Now, I'm still looking at the Senkou Spans, and there is a similar problem, but a lot bigger one (for me) :
                    ChikouSpan.Set(Period2,cs); means add the value of cs to the ChikouSpan DataSeries Period2 bars ago - my problem now is how to do the opposite with the Senkou Spans, given that I should have values in their DataSeries in the future, something like
                    but, "obviously" this cannot be done. Also, according to the documentation any DataSeries "always contains the same number of elements as bars in a chart." which seems to imply that I cannot have n bars of prices + Period3 values for the Senkou Spans. Unless I can just shift, or offset the values of one DataSeries relative to the prices one.
                    Which still one not be enough because more bars are indeed needed ahead of the last price available.

                    So, because I'm fairly new to the NinjaScript language, I'm still trying to get to know its possibilities better before I get to a simple and efficient solution.

                    In the meantime, if the answer is obvious to you, please share it with us.



                      I have revised the code to plot the ChikouSpan 26 periods in the past, and updated the source found in my original post.


                        Thanks KBJ,

                        in the meantime I found the solution to my problem with importing your code: I had created another indicator, based on the Ichimoku, that had KinjunSen, instead of Kijunsen - so, when NT tried to import it, and re-compiled dependencies this would not work - but sme detective work fixed it... as always.

                        I am still searching for a solution for the Senkou spans - how to set a value in a DataSeries x bars ahead of the current one.




                          Back to the Future


                          The SenkouSpanA & senkouSpanB are being set correctly.

                          When the Ichimoku description talks about setting a value in the future, obviously that's not possible. But you can take a value from the past and use it to set the present value, and that's what the indicator does with this code:

                          SenkouSpanA.Set( ( MAX(High,PeriodFast)[PeriodMedium] + MIN(Low,PeriodFast)[PeriodMedium]
                                           + MAX(High,PeriodMedium)[PeriodMedium] + MIN(Low,PeriodMedium)[PeriodMedium] ) / 4 );
                          The expression "[PeriodMedium]" means to take the value from PeriodMedium bars back, and that value is set as the current value for the SenkouSpanA. When looking at it from the viewpoint of when the MAX and MIN values were found, the plot is in the future relative to that point.

                          I hope this explains it satisfactorily.



                            Thanks KBJ,

                            Both for the explanation and the correction to the ChikouSpan offset.... it now appears to be plotting as it should which is great.

                            I have added the three lines of code below just under ChikouSpan.Set so lines are drawn from the current close back to the offset set bar and the last ChikouSpan plot. Also, the distance between the two appears on the chart. It allows for a quick visual on the underlying 'strength' of the ChikouSpan.

                            DrawLine("L1", 26, Close[26], 26, Close[0], Color.Blue, DashStyle.Dot, 2);

                            DrawLine("L2", 26, Close[0], 0, Close[0], Color.Blue, DashStyle.Dot, 2);

                            DrawText("T1", (Close[0] - Close[26]).ToString(), 26, Close[0] - (TickSize * 2), Color.Cyan);


                              Thanks everyone for all your contributions and clarifications.

                              I think that my quest regarding the SenkouSpans was also driven by the fact that I had seen several Ichimoku Kenko Hyo charts showing the Cloud depicted several bars ahead of the last available price, as if "predicting" future levels of support and/or resistance, thereby allowing for possible preemptive actions, depending on the strategies.

                              In the background I will sitll toy with this (I thought about using Displacement=... but this applies to the whole indicator, unless...)

                              Anyway, as it is, it's already a very good starting point
                              If and when I come up with a consistently profitable strategy using this indicator I will post it here (It it works for me, and I prefer intraday FX, it might work for you all too).

                              This is indeed a great community of users,



                              Latest Posts


                              Topics Statistics Last Post
                              Started by aligator, Today, 02:12 PM
                              0 responses
                              Last Post aligator  
                              Started by Roman Hrabovskyi, Today, 01:46 PM
                              1 response
                              Last Post NinjaTrader_PaulH  
                              Started by The_Saint, Today, 12:44 PM
                              0 responses
                              Last Post The_Saint  
                              Started by 12VMan, Today, 12:43 PM
                              0 responses
                              Last Post 12VMan
                              by 12VMan
                              Started by pvtrader, Today, 10:34 AM
                              3 responses
                              Last Post NinjaTrader_Manfred