SH's 315 Strategy - how to use if effectively

rkkarnani

Well-Known Member
Taruj,

I didn't understand your question. My view is also same of yours there is no crossover so no point of entering. It is good to know that you made profit in ASHOKLEY. I don't do ASHOKLEY because when we assess the profit vs risk it doesn't show me a legitimate trade as risk is tend to be more. This is my view and you might differ on this.

as a rule always backtest. All of us normally do the mistake of backtest looking at daily chart for past year or two and see it looks great. Actually when it comes to real trade with money the picture is different. Trust me I have lost a lot with the process of this backtest.

Read Elder (if you have not done before) on how to backtest. I tried it. Very much tedious, but really works.
Which Elder book are you referring to?
 
Well My question was not to you but in general. Thanks for the idea on backtesting. I had one question though ( am assuming you are using 3/15) is that assuming the crossover has happened, is there any way of joining the trend except when there is a pull back? or would the other entries be very risky?

brgds,
 
Well My question was not to you but in general. Thanks for the idea on backtesting. I had one question though ( am assuming you are using 3/15) is that assuming the crossover has happened, is there any way of joining the trend except when there is a pull back? or would the other entries be very risky?

brgds,
In my experience, other entries are risky. I have traded in NIFTY after crossover happened three/four days before I entered (still using pullback). My idea was the market is moving up and still I would be able to make some good money entering pull back. That's when I got slapped with market reversed and my SL hit. Still it is a learning and I was safe because I follow Entry,Exit and SL religiously and lost only a few points. I would suggest not to enter later than crossover. one day is fine but watching in EOD and enter when crossover works far better than entering next day (as we might lose on gap up).

Elder book is Come Into my Trading Room. Fantastic book and his principle of Triple Screen works very well. I am testing using some paper trades and it is awesome.
 

rkkarnani

Well-Known Member
Elder's Tripple Screen AFL... please do not ask me for corrections if thisAFL does not work. I have it on my system and as it was reffered here I am sharing.. I dont have Ami and hv never used it !

//------------------------------------------------------------------------------
//
// Formula Name: Elder Triple Screen Trading System.
// Author/Uploader: Dennis Skoblar
// E-mail: [email protected]
// Date/Time Added: 2006-01-27 02:07:40
// Origin: Derrived from "Trading For A Living" and "Come Into My Trading Room" by Alexander Elder.
// Keywords: Elder Triple Screen Trading System
// Level: medium
// Flags: system,exploration,indicator
// Formula URL: http://www.amibroker.com/library/formula.php?id=582
// Details URL: http://www.amibroker.com/library/detail.php?id=582
//
//------------------------------------------------------------------------------
//
// This scan finds candidates by the Weekly MACD Historgam slope, and the
// Daily 2 Period Force Index dipping above or below it's Zero Line. Plot a
// Weekly 26 Period EMA to
//
// help confirm the weekly direction. It should be rising along with an uptick
// on the Weekly MACD Histogram to go long. However, Elder writes that
// divergences in the MACD
//
// Histogram override the EMA. The Daily 2 Period Force Index will be below
// it's Zero Line. Look for the stock to pullback to around it's Daily 13
// Period EMA. Also use the
//
// Daily 22 Period EMA to confirm the direction of the daily trend. Do the
// opposite for shorts. Use the Long/Short EMA Weekly Direction Tabs as
// filters to cull through the
//
// scan to only display the Weekly EMA going in the intended trading
// direction. Use the Long/Short Elder Ray Tabs (BullPower AND BearPower) to
// fine tune the entry signals.
//
// This tab is best used when in agreement with the Long/Short EMA Weekly
// Direction Tabs. A 50 Period EMA > 100000 is used to Filter Volume. A
// minimum of a 5 point run in
//
// one Month is used as a Filter for a stock's range. This scan is best used
// as an Exploration.
//
//------------------------------------------------------------------------------

// Elder Triple Screen Trading System.
// Coded by Dennis Skoblar 7/05/2005.
// Derrived from "Trading For A Living" and "Come Into My Trading Room" by Alexander Elder.

// This scan finds candidates by the Weekly MACD Historgam slope, and the Daily 2 Period Force Index dipping above or below it's Zero Line. Plot a Weekly 26 Period EMA to
// help confirm the weekly direction. It should be rising along with an uptick on the Weekly MACD Histogram to go long. However, Elder writes that divergences in the MACD
// Histogram override the EMA. The Daily 2 Period Force Index will be below it's Zero Line. Look for the stock to pullback to around it's Daily 13 Period EMA. Also use the
// Daily 22 Period EMA to confirm the direction of the daily trend. Do the opposite for shorts. Use the Long/Short EMA Weekly Direction Tabs as filters to cull through the
// scan to only display the Weekly EMA going in the intended trading direction. Use the Long/Short Elder Ray Tabs (BullPower AND BearPower) to fine tune the entry signals.
// This tab is best used when in agreement with the Long/Short EMA Weekly Direction Tabs. A 50 Period EMA > 100000 is used to Filter Volume. A minimum of a 5 point run in
// one Month is used as a Filter for a stock's range. This scan is best used as an Exploration.

TimeFrameSet( inWeekly );
WeeklyMACD = MACD(12,26) - Signal(12,26,9);
WeekHistRising = Ref(WeeklyMACD, -1) < Ref(WeeklyMACD, 0);
WeekHistFalling = Ref(WeeklyMACD, -1) > Ref(WeeklyMACD, 0);
FIWeekly = EMA(V*(C-Ref(C,-1)),13);
WeeklyForceIndexLong = FIWeekly > 0;
WeeklyForceIndexShort = FIWeekly < 0;
TimeFrameRestore();

// Weekly criteria
MACDLongW = WeekHistRising;
MACDShortW= WeekHistFalling;
FILongW = WeeklyForceIndexLong;
FIShortW = WeeklyForceIndexShort;

// Daily criteria
FIDaily = EMA(V*(C-Ref(C,-1)),2);
FILongD = FIDaily < 0;
FIShortD = FIDaily > 0;
VFilter = EMA(V,50) > 100000;
TenTwentyFilter = HHV(H,20)-LLV(L,20); // How much price has gone in one month (>=10 points preferable)
FiftyDayHVFilter = round(StDev(log(C/Ref(C,-1)),50)*100*sqrt(256)); // One year volotility (>=40 preferable)
bullpower= High - EMA(Close,13);
bearpower= Low - EMA(Close,13);

// Scan criteria
ElderLong = MACDLongW AND FILongD AND FILongW;
ElderShort = MACDShortW AND FIShortD AND FIShortW;

// Columns for exploration

NumColumns = 12;

Column0 = FullName();
Column0Name = "Ticker name";

Column1 = " ";
Column1Name =" ";

Column2 = ElderLong;
Column2Name = "Long";

Column3 = ElderLong AND EMA(C,130) > Ref(EMA(C,130),-5);
Column3Name = "Long EMA Weekly Direction";

Column4 = Column3 AND (bearpower < 0 AND bullpower > 0);
Column4Name = "Long Elder Ray Filter";

Column5 = " ";
Column5Name =" ";

Column6 = ElderShort;
Column6Name = "Short";

Column7 = ElderShort AND EMA(C,130) < Ref(EMA(C,130),-5);
Column7Name = "Short EMA Weekly Direction";

Column8 = Column7 AND (bearpower < 0 AND bullpower > 0);
Column8Name = "Short Elder Ray Filter";

Column9 = " ";
Column9Name =" ";

Column10 = TenTwentyFilter;
Column10Name = "One Month Point Range";

Column11 = FiftyDayHVFilter;
Column11Name = "Historical Volotility 50 Day";

AddTextColumn( IndustryID(1), "Industry" );

AddTextColumn( MarketID(1), "Market" );

// Filters
Filter = VFilter AND (ElderLong OR ElderShort);
Buy = ElderLong;
Sell = 0;
Short = ElderShort;
Cover = 0;

// ----------------------------------------------------------------------------------------------------------------------

// Charts -- (cut and paste the chart/indicator to it's own window with it's own file name and remove the Remark Slashes "//", except
// for the first line, this line desctibes the chart function. Example...leave "//Weekly Bar Chart" from the following first line as as.

// Weekly Bar Chart
//_SECTION_BEGIN("Weekly Graph");
//TimeFrameSet( inWeekly );
//wo = O;
//wh = H;
//wl = L;
//wc = C;
//TimeFrameRestore();
//PlotOHLC( wo, wh, wl, wc, "Weekly Close", colorCustom9, styleBar );
//_SECTION_END();

//_SECTION_BEGIN("EMA");
//P = ParamField("Price field",-1);
//Periods = Param("Periods", 15, 2, 200, 1, 10 );
//Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorYellow ), ParamStyle("Style") );
//_SECTION_END();

// ----------------------------------------------------------------------------------------------------------------------

// Weekly Force Index 13 Chart
//_SECTION_BEGIN("Weekly Force Index Thirteen Period");
//TimeFrameSet( inWeekly );
//FI=EMA(V*(C-Ref(C,-1)),13);
//TimeFrameRestore();
//Plot(FI,"FI",colorCustom11,styleLine);
//Plot(0,"ZERO LINE",colorWhite,styleThick);
//_SECTION_END();

// ----------------------------------------------------------------------------------------------------------------------

// Weekly MACD Histogran
//_SECTION_BEGIN("Weekly MACD");
//TimeFrameSet( inWeekly );
//MACDw = MACD( 12, 26 ) - Signal( 12, 26, 9 );
//MACDwLINE = MACD( 12, 26 ) ;
//MACDwSignal = Signal( 12, 26, 9 );
//TimeFrameRestore();
//Plot(MACDw,"MACD Weekly",colorYellow,styleHistogram);
//Plot(MACDwLINE,"MACD Weekly Line",colorRed,styleLine);
//Plot(MACDwSignal,"MACD Weekly Signal Line",colorBlue,styleLine);
//_SECTION_END();

// ----------------------------------------------------------------------------------------------------------------------

// Daily Bar Chart
//_SECTION_BEGIN("Elder Daily Chart with Envelope");
//SetChartOptions(0,chartShowArrows|chartShowDates);
//Plot( EMA(C,13),"EMA(13)",colorRed,styleLine);
//PlotForeign(GetBaseIndex(),IndustryID(1),colorWhite,styleLine|styleLeftAxisScale);
// LookBkPd = 100 ;
// AvgPd = 22 ;
// ExternalBarPct = 15 ;
// ConvergePct = 2 ;
// Middle = EMA( C,AvgPd ) ;
// Rng = HHV( H,LookBkPd ) - LLV( L,LookBkPd ) ;
// X = Rng ;
// deltaX = X/2 ;
// do
// {
// Over = H > Middle + X ;
// Under = L < Middle - X ;
// OuterPct = 100*( Sum( Over, LookBkPd ) + Sum( Under, LookBkPd )
// )/LookBkPd ;
// OP = LastValue(OuterPct) ;
// X=X+sign( OP - ExternalBarPct )*deltaX ;
// deltaX = deltaX/2 ;
// }while ( abs( OP - ExternalBarPct ) > ConvergePct ) ;
// Plot( Middle, "MA", colorYellow, styleLine|styleNoTitle ) ;
// Plot( Middle+X, "MA", colorSkyblue, styleDashed|styleNoTitle ) ;
// Plot( Middle-X, "MA", colorSkyblue, styleDashed|styleNoTitle ) ;
//_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", colorCustom9 ), styleBar | ParamStyle("Style") | GetPriceStyle() );
//_SECTION_END();

// ----------------------------------------------------------------------------------------------------------------------

// Daily Force Index 2 Period
//_SECTION_BEGIN("Force Index 2 Day");
//FI=EMA(V*(C-Ref(C,-1)),2);
//Plot(FI,"FI",colorCustom11,styleLine);
//Plot(0,"ZERO LINE",colorWhite,styleThick);
//_SECTION_END();

// ----------------------------------------------------------------------------------------------------------------------

// Daily MACD Histogram
//_SECTION_BEGIN("MACD");
//r1 = Param( "Fast avg", 12, 2, 200, 1 );
//r2 = Param( "Slow avg", 26, 2, 200, 1 );
//r3 = Param( "Signal avg", 9, 2, 200, 1 );
//Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") );
//Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") );
//Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) );
//_SECTION_END();

// ----------------------------------------------------------------------------------------------------------------------

// Daily BullPower
//_SECTION_BEGIN("Bull Power EMA");
///*Bull Power*/
//Lookback = Param ("EMA Lookback",13);
//BullPower = High - EMA(Close,Lookback);
//Plot (BullPower, "", ParamColor ("Color", colorCustom11), styleHistogram );
//Title = Name() + " " + Date() + " Bull Power" + WriteVal (Lookback, 3.0) + " Day: " + WriteVal (BullPower, 5.3);
//GraphXSpace = 5;
//_SECTION_END();

// ----------------------------------------------------------------------------------------------------------------------

// Daily BearPower
//_SECTION_BEGIN("Bear Power EMA");
///*Bear Power*/
//Lookback = Param ("EMA Lookback", 13);
//BearPower = Low - EMA(Close,Lookback);
//Plot (BearPower, "", ParamColor ("Color", colorRed), styleHistogram );
//Title = Name() + " " + Date() + " Bear Power" + WriteVal (Lookback, 3.0) + " Day: " + WriteVal (BearPower, 5.3);
//GraphXSpace = 5;
//_SECTION_END();

// End ---------------------------------------------------------------------------------------------------------------------
 
Elder's Tripple Screen AFL... please do not ask me for corrections if thisAFL does not work. I have it on my system and as it was reffered here I am sharing.. I dont have Ami and hv never used it !
rkkarnani,

Thanks for sharing. I use amibroker with RT from google intraday using amiquote. It is the cheapest real time data you could ever get in India.

One thing I have noticed and which, Elder also have mentioned in his book is we need to understand the indicators and modify it for our usage. I tried using this AFL and later created my own to suit individual stocks. For example channel varies for different stock. Try using same channel for NIFTY and ASHOKLEY, it will never work. NIFTY will be 95% inside channel and ASHOKLEY will be 60% outside the channel. You need to fine tune it based on what stock you analyse.

One thing I admire Stock Hunter is that, his 315 works for almost all the stocks I have used.
 
Has anybody done Elder SafeZone Stop AFL for AmiBroker. I did in Excel and it is really good. I tried writing AFL and not able to succeed. Problem is when the price keeps going down SafeZone SL moves down. Maybe my programming quality sucks. If anybody tried this or has written that would be great. It will be of great help.
 
so i have a question on this strategy if any follower could guide...

lets say i open a position on cross of 3 to 15 upside... now lets say my price is 100 Sl is 97 and lets say that for 4 days the stock kept hovering around 102 to 98... what should one do... should the position be squared like on basis of number of bars momentum is not received..?

please guide...

thanks
Ritesh
 

prst

Well-Known Member
so i have a question on this strategy if any follower could guide...

lets say i open a position on cross of 3 to 15 upside... now lets say my price is 100 Sl is 97 and lets say that for 4 days the stock kept hovering around 102 to 98... what should one do... should the position be squared like on basis of number of bars momentum is not received..?

please guide...

thanks
Ritesh
as per the basic SH method, you square off once the 3 ema moves against your direction for 2 consecutive days.
guys, plz correct me if am wrong.
 
so i have a question on this strategy if any follower could guide...

lets say i open a position on cross of 3 to 15 upside... now lets say my price is 100 Sl is 97 and lets say that for 4 days the stock kept hovering around 102 to 98... what should one do... should the position be squared like on basis of number of bars momentum is not received..?

please guide...

thanks
Ritesh
Depends on the scrip. It is normally advisable to use this in scrip which gives you a good breadth for trading. EMA is not much useful if the envelope is too narrow as the upside/downside will not give you much breadth for trading. I mostly use this strategy in NIFTY and which gives a good breadth in both up/down trend/trading range.

You could cover the scrip you hold and identify one which gives you the breadth and trade.
 

Similar threads