Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
ZEMA-atr-trading system for Amibroker (AFL)
Zero lag EMA crossover trading system
You go long/short based on when the faster ema crosses the slower one. The SL is decided by an ATR line that follows the price either up or down.
Similar Indicators / Formulas
Indicator / Formula
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 | _SECTION_BEGIN ( "ZEMA ATR" ); Period1= Param ( "Period 1" ,10,1,100,1); //Period1=Optimize("Period 1",10,1,25,1); EMA1= EMA ( C ,Period1); EMA2= EMA (EMA1,Period1); Difference= EMA1 - EMA2; ZeroLagEMA1= EMA1 + Difference; Period2= Param ( "Period 2" ,20,1,100,1); //Period2=Optimize("Period 2",10,1,25,1); EMA3= EMA ( C ,Period2); EMA4= EMA (EMA3,Period2); Difference= EMA3 - EMA4; ZeroLagEMA2= EMA3 + Difference; Plot (zerolagema1, "" , colorBlue ); Plot (zerolagema2, "" , colorRed ); pds= Param ( "ATR Periods" ,7,3,100,1); //pds=Optimize("pds",7,3,10,1); pdslong=pdsshort=pds; //pdsshort=Param("pds short",7,5,100,1); //pdslong=Param("pds long",7,5,100,1); ATRmultiple= Param ( "ATR Multiple" ,3,1,5,0.1); //ATRmultiple=Optimize("ATRmultiple",3,1,5,0.1); AvgATRShort= ATRmultiple* ATR (pdsshort); AvgATRLong= ATRmultiple* ATR (pdslong); Ststop= LLV (( LLV ( L ,pdsshort)+ AvgATRShort),pdsshort); Lgstop= HHV (( HHV ( H ,pdslong)- AvgATRlong),pdslong); Ststop = LLV (Ststop, pdsshort); Lgstop = HHV (Lgstop, pdslong); //ApplyStop(stopTypeTrailing, stopModePoint, Ref(ATRmultiple*ATR(pdslong),-1),True, True); //Equity(1); //Plot(Sell = 4,"ApplyStop Sell",colorRed,1|styleOwnScale); //Plot(Cover=4,"ApplyStop Cover",colorGreen,1|styleOwnScale); // Does this do anything. I dont know how to check. ZemaBuy = ( Cross (zerolagema1,zerolagema2)); ZemaSell = ( Cross (zerolagema2,zerolagema1)); Short = Cross (Lgstop, C ); Cover = Cross ( C , Ststop); Short = ExRem ( Short , Cover ); Cover = ExRem ( Cover , Short ); Buy = Cover ; Sell = Short ; Buy = ExRem ( Buy , Sell ); Sell = ExRem ( Sell , Buy ); Stop= IIf ( Sell , Ststop, IIf ( Buy , Lgstop, Ststop)); //Stop=IIf(Buy, Ststop, Lgstop); //Stop = Buy * Lgstop + Sell * Ststop); /* Need some code here to do the following /* a) During SHort trade, Stop=Ststop, and during Long Trade, Stop=Lgstop /* b) Plot only on stop loss, either Ststop or Lgstop, based on whether we are in LOng trade or Short Trade /* c) During Short trade, Ststop of each bar should be equal to or lower than the previous bars Ststop. Reset Lgstop /* d) During Long trade, Lgstop of each bar should be equal to or Greate than the previous bar's Lgstop. Reset Ststop */ PlotShapes ( IIf (ZemaBuy, shapeHollowUpArrow , shapeNone ), colorGreen ); PlotShapes ( IIf (ZemaSell, shapeHollowUpArrow + shapePositionAbove, shapeNone ), colorRed ); shape = Buy * shapeUpArrow + Sell * shapeDownArrow ; PlotShapes ( shape, IIf ( Buy , colorGreen , colorRed ), 0, IIf ( Buy , Low , High )); Plot (Ststop, " SL for shorts " , colorGreen , styleDots | styleNoLine ); Plot (Lgstop, " SL for long " , colorRed , styleDots | styleNoLine ); //Plot(Stop, "Stop Loss", colorBlue,styleDots|styleNoLine); // Need to plot one single stop loss, Green if its Lgstop (OR) Red if it is Ststop. _SECTION_END (); |
1 comments
Leave Comment
Please login here to leave a comment.
Back
ZEMA isn’t used in trading signals.
Why?