VKR's 4HL INTRADAY/SWING TRADE SETUP

veluri1967

Well-Known Member
#81
This was one of the strategies that could be back tested in just an excel sheet. I have taken the Nifty F1 data from January 01 2009 till 20 Nov from NSE website.
Entry: Break of 4 day High/Low
Stops for Longs: Highest Low of 4 days
Stops for shorts: Lowest High of 4 days.

No entry on the date of exit. On the days it opened beyond entry level no trade taken. On the day the trade is taken, if the stops were triggered we exit else carry forward. Yes that happened on quite a few days. Please take a look at the data analyzed in excel sheet and make your comments. Column M defines the stops for the day, and Column L indicates whether the stops were triggered or not. If it was triggered then no entry is seen on that day. Cost of transaction is taken at 0.1%. If there are any errors in data or analysis, will be happy to amend.



http://www.4shared.com/file/163901032/6e89a30b/4DHL.html
Great effort.
I donot have Nifty futures data to express my doubts.
If you donot mind can you please open Nifty chart from 1.1.2009.
We can see that 5th trading day ie 7.1.2009 has breached both HH and LL of last 4 days.
What could be result if we opened long and short on the same day. No doubt there is loss.
But as per this setup we have to open the trade when either HH and LL is broken.
How could be the strategy to hold first initiated trade only and neglecting the other signal for the day. To test its impact, we need intraday data/chart. Is it not?

See my VISUAL backtesting on Nifty FROM 1/1/2009 TO 31/1/2009.

07/1/2009 LONG 3141
07/1/2009 COVERED 3056 (-85 POINTS)
09/1/2009 SHORT 2888
14/1/2009 COVERED 2802 (+86 POINTS)
15/1/2009 SHORT 2720
16/1/2009 COVERED 2802 (-82 POINTS)
19/1/2009 LONG 2853
20/1/2009 COVERED 2819 (-24 POINTS)
22/1/2009 SHORT 2690
23/1/2009 COVERED 2744 (-54 POINTS)
28/1/2009 LONG 2783
30/1/2009 COVERED 2795 (+12 POINTS)

NET RESULT = -147 POINTS

There is lot of variation between excel which is drawn on Nifty futures data and above is drawn on Nifty data. A point to be noted.


Hi...RKKarnani...I think I have given u the breakout day both on HH and LL.ie 7.1.2009.
Please have a look at it.
Also looking forward your patch up for Gap Up and Downs.

Thanks
 
Last edited:

karthik_sri

Well-Known Member
#82
This was one of the strategies that could be back tested in just an excel sheet. I have taken the Nifty F1 data from January 01 2009 till 20 Nov from NSE website.
Entry: Break of 4 day High/Low
Stops for Longs: Highest Low of 4 days
Stops for shorts: Lowest High of 4 days.

No entry on the date of exit. On the days it opened beyond entry level no trade taken. On the day the trade is taken, if the stops were triggered we exit else carry forward. Yes that happened on quite a few days. Please take a look at the data analyzed in excel sheet and make your comments. Column M defines the stops for the day, and Column L indicates whether the stops were triggered or not. If it was triggered then no entry is seen on that day. Cost of transaction is taken at 0.1%. If there are any errors in data or analysis, will be happy to amend.



http://www.4shared.com/file/163901032/6e89a30b/4DHL.html
Dear Trader.Trends,
Thanks for sharing your excel sheet. The data what you have backtested is of EOD & for positional trading right. Also the net profit from Jan'09-Nov'09 is Rs.6k please correct me if am wrong.

I am also working on such a backtesting on intraday trades. Will post my excel sheet in a day or two.

Cheers,
Karthik
 

karthik_sri

Well-Known Member
#83
Hello,
i have attached my back testing done on intraday data on NIFTY futures contract.

1). I have taken my profit % as 0.50%
2). SL as 1%
3). Entry on 4 day high/low breakout
4). Entry time given for each and every trade with explanation on comments coloumn for SL/no hit trades.

The attached excel file will give you all the required information. The backtesting period is from Apr'09 to Nov'09 covering 8 months with 166 trading days. I have taken capital investment of Rs.30k with 1 lot of NIFTY. The margin/gain (excluding brokerage) at the end of Nov'09 is 101.77% with GP of Rs.30,531/-:clap: Request members to view and share their feedback.

Just to reiterate though i know the entry rule of high/low break i have fixed exit/profit % as 0.50% with SL of 1%.

Cheers,
Karthik
 

trader.trends

Well-Known Member
#85
Dear Trader.Trends,
Thanks for sharing your excel sheet. The data what you have backtested is of EOD & for positional trading right. Also the net profit from Jan'09-Nov'09 is Rs.6k please correct me if am wrong.

I am also working on such a backtesting on intraday trades. Will post my excel sheet in a day or two.

Cheers,
Karthik
Karthik
Yes I tested the EOD data and when in doubt checked the intraday data to verify if trade could be taken or not. I am more interested in positional trading of this strategy, hence the effort. The result of the strategy is not consistent over the years. In 2008, it has given good results but poor in 2009 and okay in 2007. I am still trying for a better exit strategy to reduce losses.
 

veluri1967

Well-Known Member
#86
Karthik
Yes I tested the EOD data and when in doubt checked the intraday data to verify if trade could be taken or not. I am more interested in positional trading of this strategy, hence the effort. The result of the strategy is not consistent over the years. In 2008, it has given good results but poor in 2009 and okay in 2007. I am still trying for a better exit strategy to reduce losses.
Trader.trends,

Instead of trying to alter SL, why cannot we have a profit target. May be 5%- 10% (Optimum for Swing Trades). Generally, if our trade is in the direction of Swing, our profit target of 5-10% would get hit on the first bar itself, if late on immediate next bar. In the long swings, we can even have a trailing SL, to lock in profits. In this way, we can save ourselves from loosing the trades in case of Gap up or Gap downs days especially when we are required to square off positions.

I feel a deep trailing stop loss would let us in the long profit runs. Even a tight Trailing SL would help us, but we may get more trades.
 
#87
i made a small attempt to convert the strategy to an afl for using in intraday charts

_SECTION_BEGIN("4hl method");
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
DC=TimeFrameGetPrice( "C", inDaily, 0);
DC1=TimeFrameGetPrice( "C", inDaily, -1);
dh=TimeFrameGetPrice( "H", inDaily, 0);
dh1=TimeFrameGetPrice( "H", inDaily, -1);
dh2=TimeFrameGetPrice( "H", inDaily, -2);
dh3=TimeFrameGetPrice( "H", inDaily, -3);
dh4=TimeFrameGetPrice( "H", inDaily, -4);
DL=TimeFrameGetPrice( "L", inDaily, 0);
dl1=TimeFrameGetPrice( "l", inDaily, -1);
dl2=TimeFrameGetPrice( "l", inDaily, -2);
dl3=TimeFrameGetPrice( "l", inDaily, -3);
dl4=TimeFrameGetPrice( "l", inDaily, -4);
do1=TimeFrameGetPrice( "O", inDaily, -1);
doo=TimeFrameGetPrice( "O", inDaily, 0);
Maxh1=Max(dh1,dh2);
Maxh2=Max(dh3,dh4);
Maxh=Max(Maxh1,Maxh2);
Plot(Maxh,"maxh",colorBrown,styleLine);

Minl1=Min(dl1,dl2);
Minl2=Min(dl3,dl4);
Minl=Min(Minl1,Minl2);
Plot(Minl,"minl",colorYellow,styleLine);
Buy = Cross(Close , Maxh);
Sell = Cross( Minl,Close);
PlotShapes(Sell*shapeDownArrow,colorRed);
PlotShapes(Buy*shapeUpArrow,colorGreen);
Title = EncodeColor(colorBlack)+ "excel trade" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorBlue) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+" 4dh= "+WriteVal(Maxh)+" 4dL= "+WriteVal(Minl);

Filter=(Buy OR Sell) ;
NumColumns = 0;
AddColumn(Close,"CMP", 1.2);
AddColumn( IIf( Buy, 66, 83 ), "Signal" , formatChar,2,4 );
AddColumn(doo,"open", 1.2);
AddColumn(dH,"HIGH", 1.2);
AddColumn(dL,"low", 1.2);
AddColumn(dC,"close", 1.2);
AddColumn(Maxh,"buy value", 1.2);
AddColumn(Minl,"sell value", 1.2);

_SECTION_END();
suggestions are welcome
 
#88
Dear Karthik,
Thanks for the great effort in making us understanding through examples.
Just a quick question. How do you get the High and Low of the day of the trading, do you mean we need to consider the high and low for NIFTY F1(example) till the time of entry on that day?
I am trying the method by taking the previous 4 day high/low breakout. Does it falter?
Kindly provide guidance on this.
Regards,
msatyana
 
#89
HI veluri
thanks for such a nice thread,
your technique technique seems quite good and i too using similar set up which i would like to share , may this provide some helpful outcomes .

i use atr indicator for confirming the direction of market.

for bullish market we have , higher haighs and higer lows

for bear market lower highs and lower lows .

now suppose market is above it and bullish in daily chart , so it means that market is bullish in short or intermediate term .

now if prise is going to increase it need to make higher highs (no matter where it is going to close )

so we are going to look for inside or outside market if today range is inside previous range we are not going to trade due to inside market but in case of an outside market i.e., price breaking previous high we will enter into long position .and book profit as the price makes an new high .

opposite is also true we could short if price is below atr indicator and price breaks previous low in intraday .

any questions or suggestion are most welcomed .

atr afl for amibroker


_SECTION_BEGIN("ATRtrading");
period = Param("Period", 13, 1, 240, 1);
mult = Param("Multiplier", 1.7, 1, 240, 0.1);

f=ATR(period);

VS[0] = Close[0];
trend[0] = 0;
HighC[0]=0;
Lowc[0]=0;

for( i = period+1; i < BarCount; i++ )
{

vs = vs[i-1];
trend = trend[i-1];
highC = HighC[i-1];
lowc = lowc[i-1];

if ((trend>=0) && ( C <VS ))
{
trend =-1;
HighC = C;
lowc = C;
}

if ((trend<=0) && (C >VS))
{
trend=1;
HighC = C;
lowc = C;
}

if (trend==-1)
{
if (C<lowc) lowc = C;
VS= lowc+ (mult*f);
}


if (trend==1)
{
if (C>HighC) HighC = C;
VS= HighC-(mult*f);
}

}


Buy=Cross(Trend,0);
Sell=Cross(0, Trend);

Plot(Close,"Close",colorBlack,styleCandle);
Plot(VS, "Vol Stop",IIf(trend==1,10,11 ),styleThick);

mkol = IIf( Trend==1, 10, 11);
Plot(5, "ribbon", mkol, styleOwnScale|styleArea|styleNoLabel, 0, -5); // Weekly trend

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorBlue, colorRed ), 0, IIf( Buy, Low-f, High+f));
_SECTION_END();



for e.g.,in this period not a single day loss , but technique provides only good entry exit and sl u have to select on ur own .


happy trading

abhi :clap:


Whats is atr?