Ichimoku – Kijun Sen Crossing Tenkan Sen Arrows


Tags:
Category:
0
0

Hello Pete,

What is the code to display red or blue arrows when Kijun Sen & Tenkan Sen crossed?

Please advise. Thanks!

Marked as spam
Posted by (Questions: 23, Answers: 57)
Asked on February 29, 2020 7:40 am
518 views
0
Private answer

This was already covered in a video we published right here on the website: https://www.hahn-tech.com/thinkorswim-alert-ichimoku/

Be sure to watch the video to learn how each of the signals function and how to adjust the settings.

Edit: Depending on your goals for this signal you may consider modifying two lines of code so that it captures every single cross and not include the direction of the cloud or the location of the close above/below the cloud.

Here are the two lines of code you might want to modify:

def trendContinuationLong = bullishCloud and close > "Span B" and (Tenkan > Kijun and Tenkan[1] < Kijun[1]);
def trendContinuationShort = bearishCloud and close < "Span B" and (Tenkan < Kijun and Tenkan[1] > Kijun[1]);

.... and here is how you would modify them to remove the requirements for Cloud and close:

def trendContinuationLong = (Tenkan > Kijun and Tenkan[1] < Kijun[1]);
def trendContinuationShort = (Tenkan < Kijun and Tenkan[1] > Kijun[1]);

Marked as spam
Posted by (Questions: 37, Answers: 4086)
Answered on February 29, 2020 9:08 am
0
I downloaded and installed it. I set signal type = T/K Cross, require confirmation = No, put indicator on 4-hour time frame, but when T/K Cross occurs, sometimes the Arrow does not show. Why is that? The arrow should show at every cross since there's no confirmation required. Correct? Please advise. Thanks!
( at February 29, 2020 1:12 pm)
0
The crossing signals were based on the way Hubert Senters teaches this indicator. Which means that for a bullish cross the cloud must also be bullish and the close of the candle must be above Span B. The confirmation requirement is based on the Chikou line so turning that off does not change the requirement for bullish cloud and close above Span B. Likewise for a cross below.
( at February 29, 2020 1:22 pm)
0
I modified according to your code above, but when T/K cross, it does not display arrow. See code and screen shot below (4 hour time frame). # this signal finds the bullish crossovers of the turning line back above the standard line #def trendContinuationLong = bullishCloud and close > ”Span B” and (Tenkan > Kijun and Tenkan[1] Kijun and Tenkan[1] < Kijun[1]); # this signal finds the bearish crossover of the turning line back below the standard line #def trendContinuationShort = bearishCloud and close < "Span B" and (Tenkan Kijun[1]); def trendContinuationShort = (Tenkan Kijun[1]); Please advise. Thanks!
( at February 29, 2020 1:46 pm)
0
I checked the lines of code you provided in the comment above and it does not contain the modifications I described.
( at February 29, 2020 5:51 pm)
0
Strange! I saw the codes there. Here it is again: # this signal finds the bullish crossovers of the turning line back above the standard line #def trendContinuationLong = bullishCloud and close > ”Span B” and (Tenkan > Kijun and Tenkan[1] Kijun and Tenkan[1] < Kijun[1]); # this signal finds the bearish crossover of the turning line back below the standard line #def trendContinuationShort = bearishCloud and close < "Span B" and (Tenkan Kijun[1]); def trendContinuationShort = (Tenkan Kijun[1]); What I did with the code above was commented out the old codes (#) and pasted your codes in there.
( at February 29, 2020 6:21 pm)
0

No, it's still not correct. Just delete the original two lines and replace them with the last two lines in the answer I provided. In you comment above, the only new line you added was this:

def trendContinuationShort = (Tenkan Kijun[1]);

And it does absolutely nothing at all. Not to mention it is not even close to the code I provided in my answer.

( at February 29, 2020 7:34 pm)
0
How do I attach a screenshot? For some reason, when I copied lines of code and pasted here, it truncated the lines. I just did what you said (removed and replaced), but a certain arrow still not showing. I want to attach a screenshot for you to see instead of copy and paste. Thanks!
( at February 29, 2020 7:51 pm)
0
There is no way to attach a screenshot to a comment. You will need to post your screenshot to a cloud account of some sort and provide a link to that image. However I can guess what issue you are having. There are occasions when the two lines are of equal value for one or more bars. In this case a true "cross" will not be registered. That's just the way it is. I tested these modifications and the only so-called crosses it skips are occasions where the two lines are equal for one or more bars.
( at February 29, 2020 8:25 pm)
0
Please click on the link below to see a screenshot of my 4-hour chart. The cross happened after it made a hight at 9763, and price went down. Thus, there should be a down arrow displayed at that cross. https://drive.google.com/file/d/1Vd4RgH2JhjNKkQZeKuG0EOMp9cE6WZf3/view?usp=sharing
( at February 29, 2020 9:04 pm)
0
Yes, this demonstrates exactly what I just said in my previous comment. The line are equal for one or more bars before the cross completes. That is not going to be picked up by any code that measures a cross that occurs over two bars. The code is never going to pick up those patterns. This would require modifications well beyond the scope of what we cover in the Q&A forum.
( at March 1, 2020 8:09 am)