CNB,
Thanks for the AFL.
All the more reason for me to finally move to Amibroker
Hang on, will let you know the results soon ....
Regards,
Enygma.
Thanks for the AFL.
All the more reason for me to finally move to Amibroker
Hang on, will let you know the results soon ....
Regards,
Enygma.
Hi,
Enygma,
Here is your first afl for your Amibroker, add your "tweak" as per need.
------------------------------------------------
_SECTION_BEGIN ("Price 20EMA");
//-------Plot and explore 20EMA SGS method developed by Enygma afl by CNB------------------
GraphXSpace = 5;
//-------------- price-----------
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 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
//---------Indicator -------------------
Plot(EMA(C,20),"EMA C 20", colorRed,styleLine);
Plot(C,"close",ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle());
Buy = Cross(C, EMA(C, 20)); // AND Close > Open AND Avg_vol > 250000;
Sell = Cross(EMA(C, 20), C ); // AND Close < Open AND Avg_vol > 250000;
//-----------SIGNAL--------------//
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(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
//--------------Explore--------
Filter=Buy OR Sell;
AddColumn(TimeFrameGetPrice( "H", inDaily),"HIGH",1.2,colorDefault,colorDefault,60);
AddColumn(TimeFrameGetPrice( "L", inDaily),"LOW",1.2,colorDefault,colorDefault,60);
AddColumn(TimeFrameGetPrice( "O", inDaily),"OPEN",1.2,colorDefault,colorDefault,60) ;
AddColumn(TimeFrameGetPrice( "C", inDaily),"CLOSE",1.2,colorDefault,colorDefault,60) ;
AddColumn(TimeFrameGetPrice( "V", inDaily),"VOLUME",1.2,colorDefault,colorDefault,60) ;
AddColumn(IIf(Buy,66,IIf(Sell,83,32)),"ACTION REQUIRED", formatChar, colorWhite, bkcolor =IIf(Buy, colorGreen,IIf(Sell,colorRed,colorDefault)));
_SECTION_END();//
//--------------------------TITLE--------------------------//
_SECTION_BEGIN("Title");
Title = EncodeColor(colorBrightGreen)+"TRADING 20EMA SGS METHOD" + "-" + Name()+ "-" + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorBlack) +
" - " + Date() +" - "+"\n" +EncodeColor(colorBlack) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V);
_SECTION_END();
--------------------------------------------------------------------------
Anant and Ken I will appreciate correction/modification in the afl pl.
Regards,
CNB
Enygma,
Here is your first afl for your Amibroker, add your "tweak" as per need.
------------------------------------------------
_SECTION_BEGIN ("Price 20EMA");
//-------Plot and explore 20EMA SGS method developed by Enygma afl by CNB------------------
GraphXSpace = 5;
//-------------- price-----------
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 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
//---------Indicator -------------------
Plot(EMA(C,20),"EMA C 20", colorRed,styleLine);
Plot(C,"close",ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle());
Buy = Cross(C, EMA(C, 20)); // AND Close > Open AND Avg_vol > 250000;
Sell = Cross(EMA(C, 20), C ); // AND Close < Open AND Avg_vol > 250000;
//-----------SIGNAL--------------//
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(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
//--------------Explore--------
Filter=Buy OR Sell;
AddColumn(TimeFrameGetPrice( "H", inDaily),"HIGH",1.2,colorDefault,colorDefault,60);
AddColumn(TimeFrameGetPrice( "L", inDaily),"LOW",1.2,colorDefault,colorDefault,60);
AddColumn(TimeFrameGetPrice( "O", inDaily),"OPEN",1.2,colorDefault,colorDefault,60) ;
AddColumn(TimeFrameGetPrice( "C", inDaily),"CLOSE",1.2,colorDefault,colorDefault,60) ;
AddColumn(TimeFrameGetPrice( "V", inDaily),"VOLUME",1.2,colorDefault,colorDefault,60) ;
AddColumn(IIf(Buy,66,IIf(Sell,83,32)),"ACTION REQUIRED", formatChar, colorWhite, bkcolor =IIf(Buy, colorGreen,IIf(Sell,colorRed,colorDefault)));
_SECTION_END();//
//--------------------------TITLE--------------------------//
_SECTION_BEGIN("Title");
Title = EncodeColor(colorBrightGreen)+"TRADING 20EMA SGS METHOD" + "-" + Name()+ "-" + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorBlack) +
" - " + Date() +" - "+"\n" +EncodeColor(colorBlack) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V);
_SECTION_END();
--------------------------------------------------------------------------
Anant and Ken I will appreciate correction/modification in the afl pl.
Regards,
CNB