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

Elder Impluse with Buy/Sell for Amibroker (AFL)

Rating:
2 / 5 (Votes 5)
Tags:
trading system, amibroker

Elder Impluse with Buy/Sell

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Elder Impluse");

SetBarsRequired(100000,0);
GraphXSpace = 15;
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 ) ) ));
SetPositionSize(75,spsShares);

//MACD
r1 = Param( "Impulse Fast avg", 12, 2, 200, 1 );
r2 = Param( "Impulse Slow avg", 26, 2, 200, 1 );
r3 = Param( "Impulse Signal avg", 9, 2, 200, 1 );

ml = MACD(r1, r2);
sl = Signal(r1,r2,r3);
Hist = ml-sl;

MACUP = Hist > Ref(Hist,-1);
MACDN = Hist < Ref(Hist,-1);

MA1 = Param( "Impluse MA", 13,8, 200, 1 );

MAUP = EMA(C,MA1) > Ref(EMA(C,MA1),-1);
MADN = EMA(C,MA1) < Ref(EMA(C,MA1),-1);

//BarColor = IIf(Close == Open, colorBlack,IIf(Close>Open,colorGreen,colorRed));

BarColor  = IIf(MACUP AND MAUP,colorGreen,IIf(MACDN AND MADN,colorRed,colorBlue));


Buy = MACUP AND MAUP;// AND c>EMA(C,13);
Sell= MACDN AND MADN;

Short=MACDN AND MADN ;// and C<EMA(C,13);
Cover=MACUP AND MAUP;


Buy[BarCount-1]=Null;
Sell[BarCount-1]=Null;

Short[BarCount-1]=Null;
Cover[BarCount-1]=Null;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

short=ExRem(short,cover);
cover=ExRem(cover,short);

Long=Flip(Buy,Sell); 
Shrt=Flip(Short,Cover); 
Relax = NOT Long AND NOT Buy AND NOT shrt AND NOT Sell AND NOT Sell AND NOT Cover; 

BarsSincebuy = BarsSince( Buy ); 
BarsSinceshort = BarsSince( Short ); 
LastSignal = IIf( BarsSincebuy < BarsSinceshort, 1, -1 ); 

BuyPrice=ValueWhen(Buy,C);
SellPrice=ValueWhen(Sell,C);
ShortPrice=ValueWhen(Short,C);
CoverPrice=ValueWhen(Cover,C);

Title = EncodeColor(colorWhite)+  Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +

 "  - " + Date() +" - "+"\n" +EncodeColor(colorwhite) +"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"+EncodeColor(colorYellow)+

WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+

WriteIf(Buy  , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","");



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(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);                      
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

Plot( Close, "Price", BarColor, stylebar );
_SECTION_END();



//Magfied Market Price

FS=Param("Font Size",30,11,100,1);

GfxSelectFont("Times New Roman", FS, 700, True ); 

GfxSetBkMode( colorWhite );  

GfxSetTextColor( ParamColor("Color",colorGreen) ); 

Hor=Param("Horizontal Position",1120,1,1200,1);

Ver=Param("Vertical Position",12,1,830,1); 

GfxTextOut(""+C, Hor , Ver );

YC=TimeFrameGetPrice("C",inDaily,-1);

DD=Prec(C-YC,2);

xx=Prec((DD/YC)*100,2);

GfxSelectFont("Times New Roman", 11, 700, True ); 

GfxSetBkMode( colorBlack );  

GfxSetTextColor(ParamColor("Color",colorYellow) ); 

GfxTextOut(""+DD+"  ("+xx+"%)", Hor , Ver+45 );


_SECTION_END();

2 comments

1. suresh027

THANK YOU FOR SHARING THE SYSTEM

2. manuski

Good formula.
1- add audio alert on buy and sell signal.
2- add stop loss or trailing stop loss figure disclosure system.
3- add minimum 3 tentative targets based on Fibonacci.
Then it will be best.

Thanks

Leave Comment

Please login here to leave a comment.

Back