Pages

14 March 2011

Ichimoku Cloud Scanner v2.0 – AFL Code

The Demerit with the older version of Ichimoku cloud scanner is that there is too much of difference between the cloud(stop loss) and the candle which has been overcome by introducing stop loss for the trade with little modification in the trading rules.

The above nifty chart shows a trailing stop loss(black line) of 6034. But the cloud(6137) is heavily far from the Close value(5751).

Note : Black line indicate only trailing stop loss for trades but not a trailing stop loss mechanism.

Trading Rules

1)Buy on Close above the cloud
2)Sell on Close below the cloud
3)Use the Cloud as Stop loss and reverse when the cloud is very near to the candle
3)Use STPL – (Black line) as trailing stop loss when the candle is far from the cloud
4)There is nothing to do with the color of the cloud( red/green cloud it doesnt matter )
5)Red Arrows indicates sell signal i.e candle closes below the cloud
6)Green Arrows indicates Buy Signal i.e candle closes above the cloud

Where STPL is nothing but the average of Close, Span lines SP1,SP2

Few Rules that I for the shorter timeframes 15min, 30min, hourly Charts and Daily

1)Buy or Sell Trade should be taken only on the presence of the appropriate signal. Trade should not me initiated belated to the signal

2)Dont initiate trade without sufficient signals.

3)If you are in a Buy Trade/Sell Trade book the trade if you are in profit at regular intervals. Dont wait for the next signal to exit the trade

4)For 15min trade book profit if you got 20-25pts in nifty and in Hourly Charts – 50-75 points and in Daily Charts – 150-200pts without waiting for next signal.

5)Respect the trailing stop loss when you are in trade

6)If you are confused with the way you are playing – just take rest.


.................................................................


Ichimoku forecast: Ichimoku Kinko Hyo is Japanese for “one glance cloud chart.” It consists of five lines called Tenkan-sen, Kijun-sen (sen is Japanese for line), Senkou Span A, Senkou Span B and Chinkou Span. The calculation uses four different time periods which we call termT, termK, termS and termC. The Ichimoku Kinko Hyo is graphed over the closing price line. The space between the Senkou spans is called the Cloud, and is usually graphed in a hatched pattern.

The word Ichimoku can be translated to mean “a glance” or “one look”. Kinko translates into “equilibrium” or “balance”, with respect to price and time, and Hyo is the Japanese word for “chart”. Thus, Ichimoku Kinko Hyo simply means “a glance at an equilibrium chart”, providing a panoramic view of where prices are likely to go and the position one should undertake.

The Ichimoku Kinko Hyo or equilibrium chart isolates higher probability trades in the forex market. It is new to the mainstream, but has been rising incrementally in popularity among novice and experienced traders. More known for its applications in the futures and equities forums, the Ichimoku displays a clearer picture because it shows more data points, which provide a more reliable price action. The application offers multiple tests and combines three indicators into one chart, allowing the trader to make the most informed decision


Rules are simple
1)Buy if Candle closes above the cloud.
2)Sell if Candle closes below the cloud



ICHIMOKU AFL:

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


_SECTION_BEGIN("Ichimoku Hayo Kinko");
GraphXSpace =1;
prds = Param("Standard Line Periods?", 12,5,26,1);
prds1 = Param("Turning Line Periods?", 3,3,10,1);
prds2 = Param("Delayed Line Periods?", 11,4,25,1);
prds3 = Param("Spans Periods?", 18,10,52,1);


TL = ( HHV( H, prds1) + LLV( L, prds1) )/2;
SL = ( HHV( H, prds) + LLV( L, prds) )/2;
DL = Ref( C, prds2);
Sp1 = Ref( ( SL + TL )/2, -prds2)-(C*0.003);
Sp2 = Ref( (HHV( H, prds3) + LLV(L, prds3))/2, -prds2)+(C*0.003);

STPL=(C+sp1+sp2)/3;
Plot (STPL,"STPL",ParamColor("STPL", colorBlack), styleThick);


SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );
_N( Title = StrFormat( "{{NAME}} - " + SectorID( 1 ) + " - {{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 ) ) ) );
Plot( C, "Close", colorBlack, styleCandle | styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );

if ( ParamToggle( "Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip = StrFormat( "Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: " + NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 ) ) );
}
Buy = Cross(Close,IIf(sp1>sp2,sp1,sp2));
Sell = Cross(IIf(sp1Sp2,ParamColor("Span1 Color", ColorRGB(0,255,0)),ParamColor("Span2 Color",ColorRGB(255,104,32))),styleCloud);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorWhite)+ "NICK MA Swing System" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorRed) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+"\n"+
EncodeColor(colorLime)+
WriteIf (Buy , " GO LONG / Reverse Signal at "+C+" ","")+
WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")+"\n");



_SECTION_END();

No comments: