Skip to main content

STAN WEINSTEIN'S STRATEGY - Halan Manoj Kumar

// THIS AFL INCORPORATES MOST OF THE CONCEPTS OF STAN WEINSTEINS TRADING METHODOLOGY.
// USE ONLY WEEKLY CHART.
// THIS AFL DOES NOT GUARANTEE ANY POSITIVE RETURNS.
// USE THIS AFL AT YOUR OWN RISK
// THIS AFL WAS DEVELOPED BY HALAN MANOJ KUMAR, MSC,CAIIB,FRM,PRM,CMA,ACMA. HOWEVER IN SOME CASES INDIVIDUAL CODE SNIPPETS ARE FROM DIFFERENT SOURCES AND I THANK THOSE DEVELOPERS.
// ANY CONCEPTUAL QUERIES OR COMMENTS CAN BE MAILED TO scorpiomanoj73@gmail.com
_SECTION_BEGIN("CHART");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%)", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
//RELATIVE STRENGTH
// IF YOUR NIFTY TRADING SYMBOL IS DIFFERENT, PLEASE USE THAT INSTEAD OF ONE MENTIONED HERE.
rsmaPeriodshort = Param( "RS Short MA Period", 30, 0, 500, 1 );
rsmaPeriodlong = Param( "RS Long MA Period", 90, 0, 500, 1 );
rsSymbol = ParamStr( "Base Index Symbol", "NSENIFTY" );  //Use Index Symbol Which You have at place of NSENIFTY
rs = RelStrength( rsSymbol );
// MOMENTUM
// THIS IS USED ONLY FOR SCORING DURING EXPLORATION. IT IS NOT PART OF THE BUY SELL CONDITIONS.
_SECTION_BEGIN("MOMENTUM");
TtD_Change = 100 * (Close - Ref(Close, -12) ) / Ref(Close, -12);
_SECTION_END();
// PRICE
cmaperiod1 = Param( "Price MA Period1", 10, 0, 500, 1 );
TMA = MA(C,CMAPERIOD1);
Plot(TMA ,"SMA10WK",colorGreen,styleLine);
cmaperiod2 = Param( "Price MA Period2", 29, 0, 500, 1 );
sTMA = MA(C,cmaperiod2);
Plot(sTMA ,"SMA29WK",colorBrown,styleLine);
//cmaperiod3 = Param( "Price MA Period3", 40, 0, 500, 1 );
//LTMA = MA(C,cmaperiod3);
//Plot(lTMA,"SMA40WK",colorBlueGrey,styleLine);
// VOLUME
VOLshort = Param( "VOL Short MA Period", 30, 0, 500, 1 );
VOLlong = Param( "VOL Long MA Period", 90, 0, 500, 1 );
//CONDITIONS
RSB = MA(rs,rsmaperiodshort) > MA(rs,rsmaperiodlong) OR RS > MA(RS,RSMAPERIODLONG);
vola = V > 2 * MA(V,4) OR V > 5 * Ref(V,-1);
VOLb = Cross(V,MA(V,volshort)) OR V > MA(V,VOLSHORT);
COND1 = (Cross (C,STMA) OR C > STMA) AND C > TMA AND TMA > STMA;
COND2 = VOLA;
COND3 = RS > MA(RS,RSMAPERIODSHORT);
COND5 = C > 5;
COND6 = C > (Ref(HHV(H,52),-1));
// buy if price crosses 30wk ma or price is greater than 30 wk ma (stan weinstein's theory)
// and if vol is greater than 2 times of 4 period ma or vol is greater than 5 times the prev period (stan weinsteins general theory of vol increase. numbers are based on my experience)
// and if relative strength with respect to index is greater than 30 period ma (stan weinsteins theory of upward sloping rel strength)
// and stocks greater than rs 5 (can increase if do not want penny stocks)
// and price is greater than 52 wks high (not stan weinsteins requirement. i have added based on my experience)
// ALL ABOVE BUY CONDITIONS IDEALLY ENSURES IN MOST CASES THAT YOU ARE ENTERING IN STAGE 2
// sell if price crosses down 30 wk ma (stan weinstein's theory)
// SELL CONDITION IDEALLY ENSURES IN MOST CASES THAT YOU ARE EXITING A STOCK IN BEGINING OF STAGE 4.
Buy = COND1 AND COND2 AND COND3 AND COND5 AND COND6 AND C>O;
Sell= Cross(sTMA,H);
Buy = ExRem(Buy,SELL);
Sell = ExRem(Sell,Buy);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorYellow, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorYellow, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeHollowUpArrow, shapeNone),colorBlack, 0,L, Offset=-45);
PlotShapes(Sell*shapeStar,colorDarkRed,0,H,20);
// BACKGROUND NAME
_SECTION_BEGIN("Name");
GfxSetOverlayMode(1);
GfxSelectFont("Tahoma", Status("pxheight")/8 );
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ColorHSB( 120, 240, 180 ) );
GfxSetBkMode(0); // transparent
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/12 );
GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxSelectFont("Tahoma", Status("pxheight")/36 );
GfxTextOut( " STAN WEINSTEIN'S STRATEGY - Halan Manoj Kumar", Status("pxwidth")/2, Status("pxheight")/3 );
_SECTION_END();
_SECTION_BEGIN("position sizing");
SetOption("InitialEquity", 1000000 );
SetTradeDelays(0,0,0,0);
RoundLotSize = 1;
posqty = Optimize("PosQty", 10, 1, 20, 1 );
SetOption("MaxOpenPositions", posqty);
PositionSize = -100/POSQTY;
PositionScore = rs*100/MA(rs,rsmaperiodshort); // ENSURES YOU ENTER ONLY THOSE STOCKS WHICH HAVE HIGH RELATIVE STRENGTH IF YOU HAVE MULTIPLE BUYS.
_SECTION_END();
_SECTION_BEGIN("EXPLORATION");
Filter = Buy ;
AddColumn( Buy, "Buy", 1 );
AddColumn( V*100 / MA(V,4), "V/MAVOL", 1 );
AddColumn( rs*100/MA(rs,rsmaperiodshort) , "RS / MARS", 1 );
AddColumn(TtD_Change,"MOMENTUM SCORE",1.2,IIf(TtD_Change>0,colorDarkBlue,colorRed));
AddColumn( (V*100 / MA(V,4)) + (rs*100/MA(rs,rsmaperiodshort)) + Ttd_Change, "V + RS + MS", 1 );
AddColumn( c, "entry", 1.3 );
NoS = 100000/C;
AddColumn(NoS,"No.Shares",1.3);
AddColumn(LastValue(C,True),"cmp",1.3);
AddColumn(IIf(Buy,(LastValue(C,True)-C)*nos, (C-LastValue(C,True))*nos),"profit",1.3);
AddColumn(MA(C,30),"STOP",1.3);
_SECTION_END();

Comments

Popular posts from this blog

10K AFL FREE INTRADAY TRADING.afl

_SECTION_BEGIN("Price1"); SetChartOptions(0,chartShowArrows|chartShowDates); Plot( C, "Close", ParamColor("Color", colorRed ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); _SECTION_END(); //_SECTION_BEGIN("Pivot")     YH = TimeFrameGetPrice("H", inDaily, -1);        // yesterdays high     YL = TimeFrameGetPrice("L", inDaily, -1);        //                low     YC = TimeFrameGetPrice("C", inDaily, -1);        //                close     YO = TimeFrameGetPrice("O", inDaily);            // current day open     //Normal Pivot     PP = (YH + YL + YC) / 3;     R1 = (2 * PP) - YL;     R2 = PP + (YH - YL); ...

Wilders Most Succesful Intraday Intraday

PM1 = Param("MA1",7.5,1,1500,1); PM2 = Param("MA2",11,1,1500,1); M1 = Wilders(Close,PM1); M2 = Wilders(Close,PM2); A = Cross(M1,M2); B = Cross(M2,M1); Hor1=Param(" LEFT/RIGHT",1,1,1660,1); Ver1=Param(" UP DOWN",35,1,830,1); FS1=Param(" Font Size",15,11,100,1); GfxSelectFont("Tahoma", FS1, 200 ); GfxSetBkColor(colorBlack); GfxSetTextColor(colorGold); //GfxTextOut("EMA "+ PM1 + " "+ Prec(M1,2),Hor1,Ver1); GfxSetTextColor(colorGreen); //GfxTextOut("EMA "+ PM2 + " "+ Prec(M2,2),Hor1,Ver1+25); Plot(M1," EMA: "+pm1,ParamColor("FAST EMA COLOR",colorBrightGreen)); Plot(M2," EMA: "+pm2,ParamColor("SLOW EMA COLOR",colorRed)); PlotShapes(IIf(A,shapeUpArrow,shapeNone),colorBrightGreen,0,L,Offset= -30); PlotShapes(IIf(B,shapeDownArrow,shapeNone),colorRed,0,H,Offset = -30); Filter = (A == 1) OR (B == 1); AddColumn(A,"BUY/SELL",1,IIf(A,colorGreen,c...