Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
Find Out More Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Ichimoku Chart & Exploration for Amibroker (AFL)

Rating:
4 / 5 (Votes 3)
Tags:
amibroker, chart, ichimoku

Ichimoku chart consists of 5 lines. Four of them are calculated simply by taking the average of the highest price and the lowest price.

1. Tenkan-Sen = Conversion Line = (Highest High + Lowest Low) / 2, used for 9 sessions

2. Kijun-Sen = Base Line = (Highest High + Lowest Low) / 2, used for 26 sessions

3. Chikou Span = Lagging Span = Today’s closing price, drawn for the next 26 sessions

4. Senkou Span A = Leading Span A = (Tenkan-Sen + Kijun-Sen) / 2, drawn for the first 26 sessions

Senkou Span B = Leading Span B = (Highest High + Lowest Low) / 2, used for 52 sessions, drawn for the first 26 sessions. Also, the distance between Leading Span A and B is called “Kumo” or “Cloud”.

Ichimoku used the three main standard sessions: 9, 26 and 52. When Ichimoku was first created (in 1930), a week of trading was 6 days and the standard was chosen as 1, 1, 1, 2 and 2 months respectively. month. But now 1 week is only 5 days, the standard is 7, 22 and 44 respectively.

Screenshots

Indicator / Formula

Copy & Paste Friendly
//////////////////////////////////////////
////        - ICHIMOKU CHART -        ////
//////////////////////////////////////////
SetSortColumns(-6);

_SECTION_BEGIN("ChikouSpan");
PlotOHLC(0,Close,Close,Close,"ChikouSpan", colorYellow, styleThick,Null,Null,-25);
_SECTION_END();

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%), Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
SetBarFillColor(	IIf( C > O AND C > Ref(C,-1), colorBlack,
					IIf( C < O AND C > Ref(C,-1), colorBrightGreen, 
					IIf( C > O AND C < Ref(C,-1), colorBlack,
					IIf( C < O AND C < Ref(C,-1), colorRed, 
					IIf( C == Ref(C,-1) AND C > Ref(C, -2) AND C > O, colorBlack,
					IIf( C == Ref(C,-1) AND C > Ref(C, -2) AND C < O, colorBrightGreen,
					IIf( C == Ref(C,-1) AND C < Ref(C, -2) AND C > O, colorBlack,
					IIf( C == Ref(C,-1) AND C < Ref(C, -2) AND C < O, colorRed,
					IIf( C == Ref(C,-1) AND C == Ref(C, -2) AND C > Ref(C, -3) AND C > O, colorBlack,
					IIf( C == Ref(C,-1) AND C == Ref(C, -2) AND C > Ref(C, -3) AND C < O, colorBrightGreen,
					IIf( C == Ref(C,-1) AND C == Ref(C, -2) AND C < Ref(C, -3) AND C > O, colorBlack,
					IIf( C == Ref(C,-1) AND C == Ref(C, -2) AND C < Ref(C, -3) AND C < O, colorRed,
					Null ))))))))))))
				); 
Plot( C, "Close", IIf( C > Ref(C,-1), colorBrightGreen, IIf( C < Ref(C,-1), colorRed, 
				IIf( C == Ref(C,-1) AND C > Ref(C, -2), colorBrightGreen, IIf( C == Ref(C,-1) AND C < Ref(C, -2), colorRed,
				IIf( C == Ref(C,-1) AND C == Ref(C, -2) AND C > Ref(C, -3), colorBrightGreen, 
				IIf( C == Ref(C,-1) AND C == Ref(C, -2) AND C < Ref(C, -3), colorRed, Null )))))), styleCandle );

_SECTION_END();

_SECTION_BEGIN("TenkanSen");
TS=(HHV(High,9)+LLV(Low,9))/2;			
Plot(TS,"TenkanSen",colorRed , styleThick);
_SECTION_END();

_SECTION_BEGIN("KijunSen");
KJ=(HHV(High,26)+LLV(Low,26))/2;		
Plot(KJ,"KijunSen",colorBlue , styleThick);
_SECTION_END();

_SECTION_BEGIN("Cloud");
SpanA=(TS+KJ)/2;
SenkouSpanA =Ref((TS+KJ)/2,-26); 
SpanB=(HHV(High,52)+LLV(Low,52))/2;		
SenkouSpanB =Ref((HHV(High,52)+LLV(Low,52))/2,-26); 
PlotOHLC(0,SpanA,SpanB,SpanB,"Cloud",IIf(SpanA>SpanB,ParamColor("Color Up",colorAqua),ParamColor("Color Down",colorPink)),styleCloud+styleNoTitle+styleNoLabel,Null,Null,26);
_SECTION_END();
sa=SenkouSpanA;
sb=SenkouSpanB;

dk_date = (DateNum() > 10000 * (2017 - 1900) + 100 * 9 + 13);
// Strong //
Buy_s1 = Cross(TS,KJ) AND TS > SenkouSpanA AND KJ > SenkouSpanA AND TS > SenkouSpanB AND KJ > SenkouSpanB AND C > Ref(C,-25);	
Sell_s1 = Cross(KJ,TS) AND TS < SenkouSpanA AND KJ < SenkouSpanA AND TS < SenkouSpanB AND KJ < SenkouSpanB AND C < Ref(C,-25);	
Buy_s2 = Cross(C,KJ) AND KJ > SenkouSpanA AND KJ > SenkouSpanB AND C > SenkouSpanA AND C > SenkouSpanB AND C > Ref(C,-25);		
Sell_s2 = Cross(KJ,C) AND KJ < SenkouSpanA AND KJ < SenkouSpanB AND C < SenkouSpanA AND C < SenkouSpanB AND C < Ref(C,-25);		
Buy_s3 = Cross(C,Ref(H,-25)) AND C > SenkouSpanA AND C > SenkouSpanB;												
Sell_s3 = Cross(Ref(H,-25),C) AND C < SenkouSpanA AND C < SenkouSpanB;												
Buy_s4 = C > SenkouSpanA AND C > SenkouSpanB;
// Medium //
Buy_m1 = Cross(TS,KJ) AND IIf(SenkouSpanA > SenkouSpanB, (TS < SenkouSpanA AND KJ < SenkouSpanA AND TS > SenkouSpanB AND KJ > SenkouSpanB),		
												(TS > SenkouSpanA AND KJ > SenkouSpanA AND TS < SenkouSpanB AND KJ < SenkouSpanB));
Sell_m1 = Cross(KJ,TS) AND IIf(SenkouSpanA > SenkouSpanB, (TS < SenkouSpanA AND KJ < SenkouSpanA AND TS > SenkouSpanB AND KJ > SenkouSpanB),	
												(TS > SenkouSpanA AND KJ > SenkouSpanA AND TS < SenkouSpanB AND KJ < SenkouSpanB));
Buy_m2 = Cross(C,KJ) AND IIf(SenkouSpanA > SenkouSpanB, (C < SenkouSpanA AND KJ < SenkouSpanA AND C > SenkouSpanB AND KJ > SenkouSpanB),		
												(C > SenkouSpanA AND KJ > SenkouSpanA AND C < SenkouSpanB AND KJ < SenkouSpanB));
Sell_m2 = Cross(KJ,C) AND IIf(SenkouSpanA > SenkouSpanB, (C < SenkouSpanA AND KJ < SenkouSpanA AND C > SenkouSpanB AND KJ > SenkouSpanB),		
												(C > SenkouSpanA AND KJ > SenkouSpanA AND C < SenkouSpanB AND KJ < SenkouSpanB));
// Weak //
Buy_w1 = Cross(TS,KJ) AND TS < SenkouSpanA AND KJ < SenkouSpanA AND TS < SenkouSpanB AND KJ < SenkouSpanB							
						AND IIf(C < Ref(C,-25), (TS > Ref(C,-25) AND KJ > Ref(C,-25)), (TS < Ref(C,-25) AND KJ < Ref(C,-25)));
Sell_w1 = Cross(KJ,TS) AND TS > SenkouSpanA AND KJ > SenkouSpanA AND TS > SenkouSpanB AND KJ > SenkouSpanB							
						AND IIf(C < Ref(C,-25), (TS > Ref(C,-25) AND KJ > Ref(C,-25)), (TS < Ref(C,-25) AND KJ < Ref(C,-25)));
Buy_w2 = Cross(C,KJ) AND C < SenkouSpanA AND KJ < SenkouSpanA AND C < SenkouSpanB AND KJ < SenkouSpanB;								
Sell_w2 = Cross(KJ,C) AND C > SenkouSpanA AND KJ > SenkouSpanA AND C > SenkouSpanB AND KJ > SenkouSpanB;							


//---------------------------------------------------------------------------------------------------------------//
Filter=C>1 AND V>1000; 

AddColumn(Buy_s1, "TS_KJ", 1.0, colorBlue);
AddColumn(Buy_s2, "C_KJ", 1.0, colorBlue);
AddColumn(Buy_s3, "Chikou", 1.0, colorBlue);
AddColumn((Buy_s1 + Buy_s2 + Buy_s3 ), "TT_Buy", 1.0, colorBlue);

AddColumn(V, " Volume ", 1.0, IIf(V>=2*MA(V,10), colorViolet, IIf(V> MA(V,10) AND V<2*MA(V,10), colorBrightGreen, colorRed)));

AddColumn(MA(V,10), "  MA(V,10)  ", 1.0, colorBlack);
AddColumn(MA(V,20), "  MA(V,20)  ", 1.0, colorBlack);
AddColumn(C, " Price ", 1.0, IIf(C>Ref(H,-25), colorBrightGreen, colorRed));

1 comments

2. t.viswanath

9 SESSION = 1.5 WEEK SO standard SETTING IS 8 DAYS (7.5 DAYS) AND 22(ONE MONTH), 44(2 MONTHS).

Leave Comment

Please login here to leave a comment.

Back