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 ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | _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
Leave Comment
Please login here to leave a comment.
Back
THANK YOU FOR SHARING THE SYSTEM
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