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

Trend Catching System for Amibroker (AFL)
anandnst
about 12 years ago
Amibroker (AFL)

Rating:
3 / 5 (Votes 3)
Tags:
amibroker

This is metatrader Formula converted for amibroker. i got it in a forum and i felt like sharing with wisestocktrader fellow people.

I felt its a new and good system. So plot n enjoy it n also provide your comments about the system. Thnx you

Regards

Anand

Screenshots

Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez over 10 years ago
Advanced Elliott Waves
Submitted by MarcosEn about 13 years ago
3_6Day GuaiLiLv
Submitted by motorfly about 13 years ago
Williams Alligator System
Submitted by durgesh1712 about 13 years ago
*Level Breakout system*
Submitted by Tinych about 13 years ago
Horizontal Live Priceline Tool
Submitted by northstar about 13 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Price Chart");
bgTop = ParamColor("BgTop",    colorBlack);
bgBot = ParamColor("BgBottom", colorBlack);
SetChartBkGradientFill( bgTop ,bgBot, colorLightGrey);

pStyle = ParamList("Price Style", "Candle|Solid Candle|Bar|Line|Heikin-Ashi",2);
cBull = ParamColor("Price Bull", colorLime);
CBear = ParamColor("Price Bear", colorRed);
cLine = ParamColor("Price Line", colorWhite);


SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}}- {{INTERVAL}} {{DATE}} O= %g, H= %g, L= %g, C= %g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

ThisStyle = styleCandle;
ThisTitle = "";

_O=O; _C=C; _H=H; _L=L;

ThisColor = IIf( _C>_O, cBull, IIf(_C<_O, CBear, CLine));


switch (pStyle )
{

  case "Solid Candle":   
        SetBarFillColor( ThisColor ); 
        break;


  case "Bar": 
       ThisStyle = styleBar;
       break;

  case "Line": 
      ThisStyle = styleLine;
      ThisColor = cLine;
       break;


  case "Heikin-Ashi": 
       _C = (O+H+L+C)/4; 
		  _O = AMA( Ref( _C, -1 ), 0.5 ); 
       _H = Max( H, Max( _C, _O ) ); 
       _L = Min( L, Min( _C, _O ) ); 

       ThisColor = IIf(_C >= _O,CBull, CBear);
       SetBarFillColor( ThisColor );
 
       ThisColor = IIf(_C >= _O,cLine, cLine);
		  ThisTitle = "Heikin-Ashi";
       break;

  default:   
        SetBarFillColor( ThisColor ); 
        ThisColor = cLine;

       break;

}

   PlotOHLC( _O, _H, _L, _C, ThisTitle, ThisColor, ThisStyle); 
   GraphXSpace = 8;

_SECTION_END();


_SECTION_BEGIN("BandStop");
/* Done      by    Rajandran R */
/* Author of www.marketcalls.in  */
// BBands_Stop_v1.mq4 by igorad2004@list.ru
// translation in Amibroker AFL, E.M.Pottasch, 2011

// Modified By KelvinHand

Length=Param("Length",20, 2); // Bollinger Bands Period
Deviation=Param("Deviation",2);
// Deviation was 2
MoneyRisk=Param("Money Risk", 1);

LineStyle=ParamToggle("Display line mode", "No|Yes", 1);  // Display line mode: 0-no,1-yes  
cUpTrendLine = ParamColor("UpTrendLine", ColorRGB(65,105,225));
cDnTrendLine = ParamColor("DownTrendLine", colorRed);





// Offset Factor
TurnedUp=Nz(StaticVarGet("TurnedUp"));
TurnedDown=Nz(StaticVarGet("TurnedDown"));
SoundON = ParamToggle("Sound","Off|On",1);


procedure CalcTrend_proc(bbtop,bbbot,Length,MoneyRisk,SoundON,TurnedUp,TurnedDown)
{
global UpTrendLine;
global DownTrendLine;
global smax;
global smin;

	UpTrendLine=Null;
	DownTrendLine=Null;
	smax=Null;
	smin=Null;
	trend=0;


	for (i=Length+1; i<BarCount; i++)	
  { 
		smax[i]=bbtop[i];
		smin[i]=bbbot[i];
		if (C[i]>smax[i-1]) trend=1;
		if (C[i]<smin[i-1]) trend=-1;
		if(trend>0 && smin[i]<smin[i-1]) smin[i]=smin[i-1];
		if(trend<0 && smax[i]>smax[i-1]) smax[i]=smax[i-1];
		bsmax[i]=smax[i]+0.5*(MoneyRisk-1)*(smax[i]-smin[i]);
		bsmin[i]=smin[i]-0.5*(MoneyRisk-1)*(smax[i]-smin[i]);
		if(trend>0 && bsmin[i]<bsmin[i-1]) bsmin[i]=bsmin[i-1];
		if(trend<0 && bsmax[i]>bsmax[i-1]) bsmax[i]=bsmax[i-1];
		if (trend>0) 
		{ 
			UpTrendLine[i]=bsmin[i];
			if (SoundON==True && !TurnedUp && i==BarCount-1 && IsEmpty(UpTrendLine[i-1])) 
			{ 
				Say("Bollinger Bands going Up");
				TurnedUp=StaticVarSet("TurnedUp",1);
				TurnedDown=StaticVarSet("TurnedDown",0);

			} 
		} 
	
   	if (trend<0) 
		{ 
			DownTrendLine[i]=bsmax[i];
			if (SoundON==True && !TurnedDown && i==BarCount-1 && IsEmpty(DownTrendLine[i-1])) 
			{
				Say("Bollinger Bands going Down");
				TurnedUp=StaticVarSet("TurnedUp",0);
				TurnedDown=StaticVarSet("TurnedDown",1);
			} 
		} //if (trend<0) 
	} //for
} //procedure

	bbtop=BBandTop(C,Length,Deviation);
	bbbot=BBandBot(C,Length,Deviation);

	CalcTrend_proc(bbtop,bbbot,Length,MoneyRisk,SoundON,TurnedUp,TurnedDown);
	UpTrendSigNal=UpTrendLine AND IsEmpty(Ref(UpTrendLine,-1));
	DownTrendSigNal=DownTrendLine AND IsEmpty(Ref(DownTrendLine,-1));

  DisplayStyle = styleNoLabel|styleDots|styleNoTitle;
  if(LineStyle == 0) DisplayStyle |= styleNoLine; 


	Plot(UpTrendLine,"UPTRENDLINE",cUpTrendLine,DisplayStyle);
	Plot(DownTrendLine,"DOWNTRENDLINE",cDnTrendLine,DisplayStyle) ;

	PlotShapes(IIf(UpTrendSignal,shapeCircle,shapeNone),cUpTrendLine,0,bbbot,0);
	PlotShapes(IIf(DownTrendSignal,shapeCircle,shapeNone),cDnTrendLine,0,bbtop,0);
_SECTION_END();

_SECTION_BEGIN("Wave Channel");

cOutLine = ParamColor("Outer Line", colorWhite);
cMidLine = ParamColor("Mid Line", colorGrey40);

  Plot( MA(C, 34), "", cMidLine, styleNoLabel); 
  Plot( MA(H, 34), "", cOutLine, styleThick|styleNoLabel); 
  Plot( MA(L, 34), "", cOutLine, styleThick|styleNoLabel); 


_SECTION_END();

_SECTION_BEGIN("WMA Rainbow");

cOutLine = ParamColor("Outline", colorBlue);
cInnerLine = ParamColor("Innerline", colorDarkBlue);


  Plot( WMA(C, 2), "", cOutLine, styleThick|styleNoLabel); 
  Plot( WMA(C, 8), "", cOutLine, styleThick|styleNoLabel); 

  Plot( WMA(C, 3), "", cInnerLine, styleNoLabel); 
  Plot( WMA(C, 4), "", cInnerLine, styleNoLabel); 
  Plot( WMA(C, 5), "", cInnerLine, styleNoLabel); 
  Plot( WMA(C, 6), "", cInnerLine, styleNoLabel); 
  Plot( WMA(C, 7), "", cInnerLine, styleNoLabel); 


_SECTION_END();

18 comments

1. rh0390

Nice , Anad Da ur MACD afl also nice…
is it available in wisestocktrader brother?

2. Divyesh

@Anand Da can i give you some good Metastock formula….for Amibroker….?

3. Vijayk

how to read this/

4. kv_maligi

Looks like Kbrain trending system.
One should trade mechanically to succeed by this system

Thanks
viswanath

5. anandnst

Yes divyesh, u can mail me at Anandnst@gmail.com

6. Divyesh

@Thank you Sir……….!

will do after market hours…..!

7. kv_maligi

Have a look at this Kbrain system. Better stoploss as compared to trend catching. Plz update your results

http://www.wisestocktrader.com/indicators/3067-guppy-with-kbreain-trending-with-buy-sell-exploration

thanks
viswanath

8. Divyesh

@Anand Sir,

Sent the mail…..

Divyesh

9. trader11

please also send me.. @Divyesh

souravsaikia11@gmail.com

10. Divyesh

@trader11,
okke but will you send me back after convert to AFL…?

11. samapada

Its not working in mine……Showing Blank Chart….Pls Help me… any pulgins I need or wt….. Hope of getting help frm any1

12. nanarane

super 5 star

13. anandnst

Hello samapada,

Afl is working fine with amibroker 5.5 version.

No error or any plugin needed. Try n copy paste properly, it will work

Thnx you

Regards

Anand

14. samapada

Anandji…….Thanx for ur reply…… I’m getting white Blank Chart no candles n nothing ……since few days on every new afl’s. Need ur help on this I’ll give u mine

Fackbook Id: http://www.facebook.com/bullbeargrp?ref=tn_tnmn

wat abt urs……..for further discussion will be easy for me.

15. kelvinhand

This Script was created by me in the following public forum:
http://www.traderji.com/amibroker/74551-trend-catching-system.html

It is me converted and integrated the MT4 code and modified with the existing code of BBand stop that exist in the tj forum.

It is courtesy to mention the authors and location instead of stealing the whole code and let the whole world think that you are the creator

16. extremist

finally Some real code owner caught u Mr. anandst “the so called coder”
even i tried to make u aware of wht ur doing.
but didn’t changed.
u r doing good job but not mentioning the author’s name and not giving him the credit is really bad habit u got

i totally agree with u Kelvinhand.

And anand this site owner made good provision to give stars to the codes u like so there is no need to give stars publicly.
u r just acting like a watch dog of wisestocktrader.

if u can not create ur own code u must not comment hard on somebody’s real own work though this is a public site.

17. Shailendra-0
Very nice afl. Can you post this MACD afl ? …or if already posted then link for it ?
18. Ron1972

Hello everyone. How can I avail these triggerlines to Ninjatrader 8? Thank you

Leave Comment

Please login here to leave a comment.

Back