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 ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

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

Ichimoku AFL for Amibroker (AFL)

Copy & Paste Friendly
////////Start of AFL/////////
/*
A bullish Signal occurs when the Tenkan-Sen (RED line) crosses the Kijun-Sen
(BLUE line) from below.
Conversely, a bearish Signal is issued when the Tenkan-Sen crosses the
Kijun-Sen from above.

Support AND resistance levels are shown as Kumo (OR clouds). The Kumo can also
be used to help identify
 the prevailing trend of the market. if the price line is above the Kumo, the
prevailing trend is said to be up,
 while if the price is below the Kumo, the prevailing trend is said to be down.
The default colour here for the clouds is
light blue - but the hue, etc, parameters can be adjusted to suit the user's
display.

The theory is that the bullish signals are strong when the TL,SL Cross occurs
above the cloud; it is medium within the
cloud, AND weak if it occurs below the cloud. These are shown here as green
solid up arrows,
Conversely, the bearish signals are said to be strong when the Cross is below
the cloud AND weak when above. These signals
are plotted as down red arrows OR triangles, OR brown hollw down arrows.

As an attempt at clarity on a cluttered Plot, all Signal arrows, etc are
plotted within the clouds (rather than near the
candles as is normal). The user can also toggle between a candle Plot OR a line
Plot of the Close price, to reduce
the clutter somewhat.

A final feature of the Ichimoku chart is the VIOLET line, OR Chikou Span (OR
Lagging Span). It is said that this line
indicates the strength of the Buy OR Sell Signal. if the Chikou Span is below
the closing price AND a Sell Signal occurs,
then the strength is with sellers, otherwise it is a weak Sell Signal.
Conversely, if a Buy Signal occurs AND the Chikou
Span is above the price, then there is strength to the upside. These
considerations could  be coupled with the other
signals, if desired, but this has NOT been done here.

Final Comment: This program produces quite a pretty graph - but I have NOT so
far been impressed with the signals!

I have seen many weak signals followed by strong moves AND strong signals
followed by weak moves. Typical of technical analysis I guess. if anyone finds
the Ichimoku approach useful I would be keen to hear about it.
*/

SL = ( HHV( H, 26 ) + LLV( L, 26) )/2;// standard, base, or kijun-sen line
TL = ( HHV( H, 9 ) + LLV( L, 9 ) )/2;// turning, conversion, or tenkan-senline
DL = Ref( C, 25 );                  // delayed close price, or chikou span
Span1 = Ref( ( SL + TL )/2, -25 );      //Span1 and Span2 define the clouds
Span2 = Ref( (HHV( H, 52) + LLV(L, 52))/2, -25);

CStyle = ParamToggle("Showcandles?","N|Y");//Choose Candle or Line for Price Plot
//hue = Param("Hue",140,0,255,1);
//sat = Param("Sat",100,0,255,1);
//bri = Param("bri",220,0,255,1);

hue = Param("Hue",10,0,255,1);
sat = Param("Sat",10,0,255,1);
bri = Param("bri",20,0,255,1);

MaxGraph = 8;
Refline = (Span1 + Span2)/2;
Graph0 = Refline;
Graph0Style = 16;//No line plotted, used as a reference line for arrows etc.
if(Cstyle )
Plot(C,"Price",colorBlack,styleCandle);
else
PlotOHLC(O,H,L,C,"Price",IIf(C>O,colorGreen,colorRed),styleCandle);
//Plot(Close,"Close",colorBlack,styleThick);
Plot(SL,"SL",colorBlue,styleThick);
Plot(TL,"TL",colorRed,styleThick);
Plot(DL,"DL",colorViolet,styleLine);
PlotOHLC(Span1,Span1,Span2,Span2,"Cloud",ColorHSB(Hue,sat,bri),styleCloud);

above = IIf(TL>Span1 AND TL>Span2,1,0);
within = IIf((TL>Span1 AND TL<Span2) OR (TL<Span1 AND TL>Span2) ,1,0);
below = IIf(TL<Span1 AND TL<Span2,1,0);
Buy = Cross(TL,SL);
Sell = Cross(SL,TL);
StrongBuy = Buy AND above;
MediumBuy = Buy AND within;
WeakBuy = Buy AND below;
StrongSell = Sell AND below;
MediumSell = Sell AND within;
WeakSell = Sell AND above;


PlotShapes(StrongBuy*shapeUpTriangle,colorBrightGreen, 0, Low, Offset =-10);
PlotShapes(StrongBuy*shapeDigit1,colorBrightGreen, 0, Low, Offset =-25);
PlotShapes(MediumBuy*shapeHollowUpTriangle,colorBrightGreen, 0, Low, Offset =0);
PlotShapes(MediumBuy*shapeDigit2,colorBrightGreen, 0, Low, Offset =-15);
PlotShapes(WeakBuy*shapeHollowUpTriangle,colorGreen, 0, Low, Offset =-15);
PlotShapes(WeakBuy*shapeDigit3,colorGreen, 0, Low, Offset =-30);

PlotShapes(StrongSell*shapeDownTriangle,colorRed, 0, High, Offset =-40);
PlotShapes(StrongSell*shapeDigit1,colorRed, 0, High, Offset =55);
PlotShapes(MediumSell*shapeHollowDownTriangle,colorRed, 0, High, Offset =-40);
PlotShapes(MediumSell*shapeDigit2,colorRed, 0, High, Offset =55);
PlotShapes(WeakSell*shapeHollowDownTriangle,colorRed, 0, High, Offset =-40);
PlotShapes(WeakSell*shapeDigit3,colorRed, 0, High, Offset =55);


///////////////////////////////////////////////////////////////////////////////
Filter=StrongBuy OR MediumBuy OR WeakBuy OR StrongSell OR MediumSell OR WeakSell;

AddColumn( IIf(StrongBuy,C,IIf(StrongSell,-C,Null)) ,"STRONG",1.0,colorWhite,IIf(StrongBuy,colorBrightGreen,IIf(StrongSell,colorRed,colorBlack)));
AddColumn( IIf(MediumBuy,C,IIf(MediumSell,-C,Null)) ,"MEDIUM",1.0,colorWhite,IIf(MediumBuy,colorGreen,IIf(MediumSell,colorDarkRed,colorBlack)));
AddColumn( IIf(WeakBuy,C,IIf(WeakSell,-C,Null)) ,"WEAK",1.0,colorWhite,IIf(WeakBuy,colorGreen,IIf(WeakSell,colorDarkRed,colorBlack)));


_SECTION_END();

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | styleHidden | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

//////End of AFL/////////////
Back