Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Library

This is read-only version of AFL library entry. Ability to add user formulas and comment is only available from members-only area.

Details:

Formula name: Intraday Trend Break System
Author/Uploader: Nishant Kulkarni - nishantndk [at] yahoo.com
Date/Time added: 2010-06-27 13:28:19
Origin: Based on zig and double top double bottom reversal techniques
Keywords: Intraday Trend Break
Level: basic
Flags: system,exploration,indicator

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:


########################### Intraday Trend Break System #####################

Author : Nishant Kulkarni (nishantndk@yahoo.com)
Intraday Trend Break System. This system is based on the double bottom and double top detection technique.
A line joining two tops when connected togather and another line joining bottom line is connected togather
and when both line extended forms a funnel and a break outside gives very strong break out.

It is recomended to have Heikin Ashi plot bellow main price plot as confirmation. Big heikin ashi candles confirm price movement.

Note: Use 15 Minute interval for better result.

Disclaimer - Trade with caution. Author does not take any responsibility. The system is to guide traders and does not guaranty any performance. However I am personally using this system and booking profit, hence contributing
this formula for community as give back.

Formula:

/**
*  ###########################           Intraday Trend Break System         
#####################
*
* Author : Nishant Kulkarni (nishantndk@yahoo.com)
*
* Intraday Trend Break System. This system is based on the double bottom and
double top detection technique.
* A line joining two tops when connected togather and another line joining
bottom line is connected togather 
* and when both line extended forms a funnel and a break outside gives very
strong break out. 
* 
*
* It is recomended to have Heikin Ashi plot bellow main price plot as
confirmation. Big heikin ashi candles confirm 
* price movement. 
* 
* Note: Use 15 Minute interval for better result. 
* 
* Disclaimer - Trade with caution. Author does not take any responsibility. The
system is to guide traders and does not 
*              guaranty any performance. However I am personally using this
system and booking profit, hence contributing 
*              this formula for community as give back. 
*
*/

_SECTION_BEGIN("INIT");

	SetChartOptions(0,chartShowArrows|chartShowDates);
	ScanLookBack = Param("Scan Lookback", 2, 1, 25 );
	fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);

_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 )) ));	
	Plot( C, _DEFAULT_NAME(), colorBlack , styleNoTitle | ParamStyle("Style") |
GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("Up Trend Line");
	
	UTValue1=LastValue(Trough(L,0.5,2)); 
	UTValue2=LastValue(Trough(L,0.5,1));
	UTBar1=BarCount - 1 - LastValue(TroughBars(L,0.5 ,2)); 
	UTBar2=BarCount - 1 - LastValue(TroughBars(L,0.5 ,1));  
	UpTrendLine = LineArray( UTBar1, UTValue1, UTBar2,UTValue2, 1 );
	UTLine = LineArray( UTBar1, UTValue1, UTBar2,UTValue2, 0 );
	Plot( UpTrendLine , _DEFAULT_NAME(), colorGreen,styleLine | styleNoTitle |
styleNoLabel); 
	Plot( UTLine , _DEFAULT_NAME(), colorGreen,styleLine | styleNoTitle |
styleNoLabel); 

_SECTION_END();


_SECTION_BEGIN("Down Trend Line");

	DTValue1=LastValue(Peak(H,0.5 ,2)); 
	DTValue2=LastValue(Peak(H,0.5 ,1)); 
	DTBar1=BarCount - 1 - LastValue(PeakBars(H,0.5 ,2)); 	
	DTBar2=BarCount - 1 - LastValue(PeakBars(H,0.5 ,1));  
	DownTrendLine = LineArray( DTBar1, DTValue1, DTBar2,DTValue2, 1 );
	DTLine = LineArray( DTBar1, DTValue1, DTBar2,DTValue2, 0 );

	Plot( DownTrendLine ,_DEFAULT_NAME(), colorRed,styleLine | styleNoTitle |
styleNoLabel); 
	Plot( DTLine ,_DEFAULT_NAME(), colorRed,styleLine | styleNoTitle |
styleNoLabel);
	
	PlotText("PV = " + WriteVal(DTValue2 ,fraction), LastValue(BarIndex())+2,
(DTValue2 ), colorRed);
	PlotText("TV = " + WriteVal(UTValue2,fraction), LastValue(BarIndex())+2,
UTValue2, colorGreen);
	PlotOHLC( UpTrendLine , UpTrendLine , DownTrendLine , DownTrendLine , "",
ColorBlend( colorGreen, colorLightYellow, 0.9 ), styleCloud | styleNoRescale);
	
	Plot(LineArray( DTBar2, DTValue2, BarCount,DTValue2, 0 ),"",colorRed);
	Plot(LineArray( UTBar2, UTValue2, BarCount,UTValue2, 0 ),"",colorGreen);

_SECTION_END();

_SECTION_BEGIN("Pivot");

	YH = TimeFrameGetPrice("H", inDaily, -1);		// yesterdays high
	YL = TimeFrameGetPrice("L", inDaily, -1);		//				low
	YC = TimeFrameGetPrice("C", inDaily, -1);		//				close
	TO = TimeFrameGetPrice("O", inDaily);			// current day open

	//Normal Pivot
	PP = (YH + YL + YC) / 3;
	R1 = (2 * PP) - YL;
	R2 = PP + (YH - YL);
	R3 = YH + 2*(PP-YL);
	S1 = (2 * PP) - YH;
	S2 = PP - (YH - YL);
	S3 = YL - 2*(YH - PP) ;
	
_SECTION_END();

_SECTION_BEGIN("Title");

Title = EncodeColor(colorBlack)+ Date() + "   Close = " + EncodeColor(colorRed)
+Close +
		EncodeColor(colorBlack) + "     Open = " + EncodeColor(colorBlack) + O + 
		EncodeColor(colorBlack) + "     High = " + EncodeColor(5) + H +
		EncodeColor(colorBlack) + "      Low = " + EncodeColor(colorRed) + L +
		EncodeColor(colorBlack) + "     Volume = " + EncodeColor(colorBlack) + V +
"\n\n"+
		EncodeColor(colorBlack) + "Pivot Point= " + EncodeColor(colorBlack) + PP +
		EncodeColor(colorBlack) + "     Day's Open= " + EncodeColor(colorBlack) + TO
+"\n\n"+
		EncodeColor(colorGreen) + "If days open is greater than Pivot Point, market
is in uptrend and \n"+EncodeColor(colorRed)+"if days Open is less than Pivot
Point, market is in downtrend" +"\n\n"+
		EncodeColor(colorRed) + "R1= " + EncodeColor(colorBlack) + R1 +
		EncodeColor(colorRed) + "  R2= " + EncodeColor(colorBlack) + R2 +
		EncodeColor(colorRed) + "  R3= " + EncodeColor(colorBlack) + R3 +"\n"+
		EncodeColor(colorGreen) + "S1= " + EncodeColor(colorBlack) + S1 +
		EncodeColor(colorGreen) + "  S2= " + EncodeColor(colorBlack) + S2 +
		EncodeColor(colorGreen) + "  S3= " + EncodeColor(colorBlack) + S3 +"\n"+
		EncodeColor( colorBlack) +"____  _____  _______  _______  _______"+"\n";
 
_SECTION_END();

_SECTION_BEGIN("Target"); 

	CBuy = Cross(C,DownTrendLine);
	CSell = Cross(UpTrendLine ,C);

	baratbuy = ValueWhen(CBuy ,BarIndex()) ;
	baratsell = ValueWhen(CSell ,BarIndex()) ;

	PlotShapes(shapeUpTriangle* CBuy ,colorBlue,O,L);
	PlotShapes(shapeDownTriangle * CSell ,colorRed,O,H);


_SECTION_END();

_SECTION_BEGIN("Auto");


	Buy  = ( CBuy ) AND  ( (BarCount - baratbuy )<=ScanLookBack ); 
	Sell = ( CSell ) AND  ( (BarCount - baratsell )<=ScanLookBack  ) ;

	price = C[BarCount-1];

	AlertIf(Buy,"","Buy @"+C+"  Price @ Trigger="+price,1);
	AlertIf(Sell,"","Sell @"+C+"  Price @ Trigger="+price,2);

	Filter =  Buy OR Sell ;

	Var = WriteIf(Buy,"BUY",WriteIf(Sell,"SELL",""));

	AddTextColumn( Var , "Buy/Sell", 1.2 , colorBlack, IIf( Buy, colorLime,
IIf(Sell,colorOrange,colorWhite) ));	
	AddColumn(price ,"Price",1.2,colorBlack, IIf( Buy, colorLime,
IIf(Sell,colorOrange,colorWhite) ));
	AddColumn(C ,"Price @ Trigger",1.2,colorBlack, IIf( Buy, colorLime,
IIf(Sell,colorOrange,colorWhite) ));

	stoploss = IIf(Buy, (price  * (1-0.01)) , IIf(Sell, (price  * (1+0.01)),0));
	target1per = IIf(Buy, (price  * (1+0.01)) , IIf(Sell, (price  *
(1-0.01)),0));
	target15per = IIf(Buy, (price  * (1+0.015)) , IIf(Sell, (price *
(1-0.015)),0));
	target2per = IIf(Buy, (price  * (1+0.02)) , IIf(Sell, (price  *
(1-0.02)),0));
	
	AddColumn(stoploss ,"Stop Loss",1.2,colorBlack, IIf( Buy, colorLime,
IIf(Sell,colorOrange,colorWhite) ));
	AddColumn(target1per ,"1% Target",1.2,colorBlack, IIf( Buy, colorLime,
IIf(Sell,colorOrange,colorWhite) ));
	AddColumn(target15per ,"1.5% Target",1.2,colorBlack, IIf( Buy, colorLime,
IIf(Sell,colorOrange,colorWhite) ));
	AddColumn(target2per ,"2% Target",1.2,colorBlack, IIf( Buy, colorLime,
IIf(Sell,colorOrange,colorWhite) ));
	AddColumn(V ,"Volume",1.2,colorBlack, IIf( Buy, colorLime,
IIf(Sell,colorOrange,colorWhite) ));
	
	bardiff = BarCount - IIf(Buy,baratbuy,IIf(Sell,baratsell,0));
	AddColumn(bardiff  ,"Bar Diff",1.2,colorBlack, IIf( Buy, colorLime,
IIf(Sell,colorOrange,colorWhite) ));


_SECTION_END();

Comments:


About | Privacy | Terms of Use | Contact information
Copyright © 2001 AMIBROKER.COM