Reply To: อยากได้สูตร AFL Code ระบบ Trade แบบ Mark minervini ครับ

#21904
dreamscat
Keymaster

มีแต่สูตรผมลองเขียนเองครับ (ไม่ใช่สูตรของชมรมนะครับ) และใช้ ema แทน ma ครับ ลองไปดัดแปลงดูได้ครับ

 

// mark minervini – trend template (use EMA>MA) p.79
MA50 = EMA(C,50);
MA150 = EMA(C,150);
MA200 = EMA(C,200);
YrLo = LLV(L,240);
YrHi = HHV(H,240);
Con1 = C>MA150 AND C>MA200;
Con2 = MA150>MA200;
Con3 = MA200>Ref(MA200,-20);
Con4 = MA50>MA150 AND MA50>MA200;
Con5 = C>MA50;
Con6 = C>1.3*YrLo;
Con7 = C>0.75*YrHi;
tr3m = 0.4*(((C-Ref(C,-60))/Ref(C,-60))*100);
tr6m = 0.2*(((C-Ref(C,-120))/Ref(C,-130))*100);
tr9m = 0.2*(((C-Ref(C,-180))/Ref(C,-180))*100);
tr12m = 0.2*(((C-Ref(C,-240))/Ref(C,-240))*100);
IBDrs = tr3m + tr6m + tr9m + tr12m;
Bull = Con1 AND Con2 AND Con3 AND Con4 AND Con5 AND Con6 AND Con7;
bigwhite = C>Ref(C,-1) AND C>O AND C>L+(0.75*(H-L)) AND (H-L)>ATR(10);
set = Foreign(“set”,”c”,True);
rs = C/set;
rsma = EMA(rs,5);
diff = rs-rsma;
diffpct = (diff/rsma)*100;

//plots
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot(C,”Mark Minervini’s Trend Template”,IIf(Bull,colorLime,colorLightGrey),styleCandle);
Plot(MA50,””,colorLightBlue);
Plot(MA150,””,colorBlue);
Plot(MA200,””,colorDarkBlue);
//Plot(YrHi,”1yr high”,colorGreen);
Plot(.75*YrHi,””,colorGreen,styleDashed);
//Plot(YrLo,”1yr low”,colorRed);
Plot(1.3*YrLo,””,colorRed,styleDashed);
//Plot(IBDrs,”IBD RS” ,colorBlue,styleThick|styleOwnScale) ;
//PlotShapes(Buy*shapeUpArrow,colorGreen,0,L);
//PlotShapes(Sell*shapeDownArrow,colorRed,0,H);

// Explorer = 1 month stronger than SET + Value that than more than 5M
HiVal = V*C>5000000;
Filter = Bull AND HiVal AND StrLen(Name())<=6 AND StrRight(Name(),2)!=”-F” AND StrRight(Name(),2)!=”-P”;
AddColumn(Close,”Close”);
AddColumn(Volume,”Volume”);
AddColumn(V*C,”Trading Value”);
AddColumn(IBDrs,”IBD RS (higher = better)”,1.0);
AddColumn(diffpct,”% RS ema”,1.2);
AddColumn(bigwhite,”big white”,1.0);
SetSortColumns(-6);