TK (Tenkan Kijun) cross

rava

New member
VIP
In Ichimoku Cloud when Tenkan cross the Kijun upward/downward is called TK cross.

Trading can be performed based on the Cloud and TK cross for upward and downward direction. After the TK cross the trend is expected to continue for certain candle depending on the strength.

I am looking for a indicator that will give an up/down arrow when the TK cross then a number above the candle incrementing each candle as 1,2, 3..... then resets when the trend goes to another direction or new trend in the same direction arises. also, the script should ignore TK cross when the cross is inside the cloud.

here is the basic Ichimoku script for reference
Ruby:
input tenkan_period = 9;
input kijun_period = 26;
def Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
    def TKcross = Tenkan crosses Kijun ;

def SpanA = (Tenkan[kijun_period] + Kijun[kijun_period]) / 2;
def SpanB = (Highest(high[kijun_period], 2 * kijun_period) + Lowest(low[kijun_period], 2 * kijun_period)) / 2;
AddCloud(SpanA, SpanB, color.green, color.red);
 
Last edited by a moderator:
Solution
In Ichimoku Cloud when Tenkan cross the Kijun upward/downward is called TK cross.

Trading can be performed based on the Cloud and TK cross for upward and downward direction. After the TK cross the trend is expected to continue for certain candle depending on the strength.

I am looking for a indicator that will give an up/down arrow when the TK cross then a number above the candle incrementing each candle as 1,2, 3..... then resets when the trend goes to another direction or new trend in the same direction arises. also, the script should ignore TK cross when the cross is inside the cloud.

here is the basic Ichimoku script for reference
Ruby:
input tenkan_period = 9;
input kijun_period = 26;
def Tenkan = (Highest(high...
In Ichimoku Cloud when Tenkan cross the Kijun upward/downward is called TK cross.

Trading can be performed based on the Cloud and TK cross for upward and downward direction. After the TK cross the trend is expected to continue for certain candle depending on the strength.

I am looking for a indicator that will give an up/down arrow when the TK cross then a number above the candle incrementing each candle as 1,2, 3..... then resets when the trend goes to another direction or new trend in the same direction arises. also, the script should ignore TK cross when the cross is inside the cloud.

here is the basic Ichimoku script for reference
Ruby:
input tenkan_period = 9;
input kijun_period = 26;
def Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
    def TKcross = Tenkan crosses Kijun ;

def SpanA = (Tenkan[kijun_period] + Kijun[kijun_period]) / 2;
def SpanB = (Highest(high[kijun_period], 2 * kijun_period) + Lowest(low[kijun_period], 2 * kijun_period)) / 2;
AddCloud(SpanA, SpanB, color.green, color.red);

this plots counting numbers after a crossing.
blue and above if Tenkan crosses above kijun.
yellow and below if Tenkan crosses below kijun.

Code:
#TK_Tenkan_Kijun_cross

#https://usethinkscript.com/threads/tk-tenkan-kijun-cross.18291/
#TK (Tenkan Kijun) cross

input tenkan_period = 9;
input kijun_period = 26;
def Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
    def TKcross = Tenkan crosses Kijun ;

def SpanA = (Tenkan[kijun_period] + Kijun[kijun_period]) / 2;
def SpanB = (Highest(high[kijun_period], 2 * kijun_period) + Lowest(low[kijun_period], 2 * kijun_period)) / 2;
AddCloud(SpanA, SpanB, color.green, color.red);
#

def bn = barnumber();
def na = double.nan;

def xup =  Tenkan crosses above kijun;
def xdwn =  Tenkan crosses below kijun;

def dir = if bn == 1 then 0
 else if xup then 1
 else if xdwn then -1
 else dir[1];

def cnt = if bn == 1 then 0
 else if xup or xdwn then 1
 else cnt[1] + 1;

plot zup = if dir > 0 then cnt else na;
zup.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE); 
zup.setdefaultcolor(color.cyan);

plot zdwn = if dir < 0 then cnt else na;
zdwn.SetPaintingStrategy(PaintingStrategy.VALUES_below); 
zdwn.setdefaultcolor(color.yellow);

input test_lines = no;
plot t = if test_lines then Tenkan else na;
plot k = if test_lines then kijun else na;
addverticalline(test_lines and xup,"-", color.cyan);
addverticalline(test_lines and xup,"-", color.cyan);
#
 

Attachments

  • Capture.JPG
    Capture.JPG
    43 KB · Views: 95
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

this plots counting numbers after a crossing.
blue and above if Tenkan crosses above kijun.
yellow and below if Tenkan crosses below kijun.

Code:
#TK_Tenkan_Kijun_cross

#https://usethinkscript.com/threads/tk-tenkan-kijun-cross.18291/
#TK (Tenkan Kijun) cross

input tenkan_period = 9;
input kijun_period = 26;
def Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
    def TKcross = Tenkan crosses Kijun ;

def SpanA = (Tenkan[kijun_period] + Kijun[kijun_period]) / 2;
def SpanB = (Highest(high[kijun_period], 2 * kijun_period) + Lowest(low[kijun_period], 2 * kijun_period)) / 2;
AddCloud(SpanA, SpanB, color.green, color.red);
#

def bn = barnumber();
def na = double.nan;

def xup =  Tenkan crosses above kijun;
def xdwn =  Tenkan crosses below kijun;

def dir = if bn == 1 then 0
 else if xup then 1
 else if xdwn then -1
 else dir[1];

def cnt = if bn == 1 then 0
 else if xup or xdwn then 1
 else cnt[1] + 1;

plot zup = if dir > 0 then cnt else na;
zup.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
zup.setdefaultcolor(color.cyan);

plot zdwn = if dir < 0 then cnt else na;
zdwn.SetPaintingStrategy(PaintingStrategy.VALUES_below);
zdwn.setdefaultcolor(color.yellow);

input test_lines = no;
plot t = if test_lines then Tenkan else na;
plot k = if test_lines then kijun else na;
addverticalline(test_lines and xup,"-", color.cyan);
addverticalline(test_lines and xup,"-", color.cyan);
#

@halcyonguy,
Awesome. Thank you very much. This is exactly what i was looking for. It will be great, if some more conditions can be added.

Uptrend
The upward trend is confirmed only when
1.) Current forecast cloud matches the uptrend(green)
2.) If Chiku is above the cloud
3.) TK cross above the colud
if all these conditions are met then make the numbering bold/different color.

Downtrend
The down trend is confirmed only when
1.) Current forecast cloud matches the down trend(red)
2.) If Chiku is below the cloud
3.) TK cross below the colud
make the numbering bold/different color.
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
400 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top