Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ichimoku Kinko Yuo

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

    Ichimoku Kinko Yuo

    As an ilustration of what I did, using region colouring (please see http://www.ninjatrader-support.com/v...8759#post18759) I built what must be my first or second NT indicator - the Ichimoku Kinko Yuo (please see http://www.kumotrader.com/ichimoku_w...itle=Main_Page 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,

    JC
    Attached Files

    #2
    Nice work JC, thanks for sharing.

    Comment


      #3
      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

      Comment


        #4
        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

        Comment


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

          JC

          Comment


            #6
            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.

            Comment


              #7
              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.

              Comment


                #8
                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?

                Thanks

                Comment


                  #9
                  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.....

                  JC

                  Comment


                    #10
                    KBJ,

                    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;
                    else
                    ks = Median[0];

                    and further down... instead of
                    ChikouSpan.Set(cs);
                    it should be
                    if (CurrentBar >= Period2 )
                    ChikouSpan.Set(Period2,cs);

                    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
                    SenkouSpanA.Set(-Period3,sa);
                    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.

                    JC

                    Comment


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

                      Comment


                        #12
                        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.

                        Regards,

                        JC
                        JC

                        Comment


                          #13
                          Back to the Future

                          JC,

                          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:

                          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.

                          KBJ

                          Comment


                            #14
                            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);

                            Comment


                              #15
                              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,

                              JC

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by gemify, 11-11-2022, 11:52 AM
                              6 responses
                              803 views
                              2 likes
                              Last Post ultls
                              by ultls
                               
                              Started by ScottWalsh, Today, 04:52 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by ScottWalsh, Today, 04:29 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by rtwave, 04-12-2024, 09:30 AM
                              2 responses
                              22 views
                              0 likes
                              Last Post rtwave
                              by rtwave
                               
                              Started by tsantospinto, 04-12-2024, 07:04 PM
                              5 responses
                              70 views
                              0 likes
                              Last Post tsantospinto  
                              Working...
                              X