OTP (One Trade Perday) based on Open, Low and High values

SaravananKS

Well-Known Member
#31
Super. Thanks Saravanan. That would greatly help. Is it possible to do the backtests with the calls that we are getting around 10 AM.
Sorry for Late Reply,

I Can back test in Any condition which is Possible in excel with RT.

First I Want to confirm the Rules (Which I Got from your Prev.Thread)

Let me to say What I Have Included in my AFL. Here are the Rules I got from your thread


The "Open", "High", "Low", "Close" rows are self explanatory
Buy Above 25 EMA*- This is the 25 DAY EMA calculated from the "HIGH" value which we will use as the price to Go LONG
Sell Below 25 EMA*- This is the 25 DAY EMA calculated from the "LOW" value which we will use as the price to Go SHORT
Then we calculate the following Values*
15 DAY High AVG*- 15 DAY EMA on High
15 DAY Low AVG*- 15 DAY EMA on Low
15 DAY Open AVG*- 15 DAY EMA on Open
15 DAY Close AVG*- 15 DAY EMA on Close
25 DAY High AVG*- 25 DAY EMA on High
25 DAY Low AVG*- 25 DAY EMA on Low
25 DAY Open AVG*- 25 DAY EMA on open
25 DAY Close AVG*- 25 DAY EMA on Close
15 EMA Signal - If HIGHER HIGHS and HIGHER LOWS on 15 DAY EMA Values then BUY, If LOWER HIGHS and LOWER LOWS on 15 DAY EMA Values then SELL signal. ELSE NO Signal (VOID)
25 EMA Signal*- Same with 25 DAY EMA Values
15 EMA & 25 EMA Signals Combined - IF 15 DAY EMA = BUY and 25 DAY = BUY then BUY....
Final Signal*= Compare Previous Daysignal and then take a final signal...*
For Example if Previous Day = BUY and today = BUY then BUY
For Example if Previous Day = BUY and today = SELL then SELL
For Example if Previous Day = BUY and today = VOID then CLOSE BUY
There are many combinations
Decision based on Signal - We will get a combined signal like "STAY LONG" or "CLOSE LONG and SELL SHORT". So we might have one signal for LONG and another signal for SHORT
LONG Signal*- The Signal for LONG Positions

So at the End of day 02-Sep, we have a LONG Signal called "BUY LONG" and Buy above 5481
On 03-Sep the opening price was 5486 and so we go long ar 5486
On 03-Sep after market opening market made low of 5474 and so our stoploss of 10 points hit. So loss of 10 points on 03-Sep

So at the End of day 03-Sep, we have a LONG Signal called "STAY LONG" above 5483
On 06-Sep the opening price was 5480 and so we go long above 5483 only andso we bough at 5484
On 06-Sep after market opening market made a low of 5480 and so our Stoploss would not have hit.
Market closed around 5577 and so we make a profit of 93 points.

07-Sep is similar to 06-Sep...

Let me know if you have understood, If you know excel a bit, you can see all the formulas used in the calculation....

At the end 03-Sep for 15-DAY EMA Signal, you can obserer that all the Open, High, Low and Close are higher than the previous days values*
5490 > 5487 (High), 5433 > 5427(Low), 5459 > 5455(Open), 5461 > 5458(Close). Since it is making HIGHER HIGHs we get a BUY signal

Same for 25 DAY EMA*
5483 > 5480(High), 5427 > 5423 (Low), 5453 > 5451(Open) , 5455 > 5453 (Close) . Since 25 DAY EMA making Higher HIGHs we get a BUY signal in 25 DAY EMA also...



I tried to write an AFL Based on the above conditions Then I left the process since back results were not so promising

Raj,
If You have any diffrent conditions then let me to know the Calculation details then I will try to modify the AFL


Normally I will Backtest any system for one or two counter. If it give good results then I will check for other counters also.
 

healthraj

Well-Known Member
#32
Sorry for Late Reply,

I Can back test in Any condition which is Possible in excel with RT.

First I Want to confirm the Rules (Which I Got from your Prev.Thread)

Let me to say What I Have Included in my AFL. Here are the Rules I got from your thread


The "Open", "High", "Low", "Close" rows are self explanatory
Buy Above 25 EMA*- This is the 25 DAY EMA calculated from the "HIGH" value which we will use as the price to Go LONG
Sell Below 25 EMA*- This is the 25 DAY EMA calculated from the "LOW" value which we will use as the price to Go SHORT
Then we calculate the following Values*
15 DAY High AVG*- 15 DAY EMA on High
15 DAY Low AVG*- 15 DAY EMA on Low
15 DAY Open AVG*- 15 DAY EMA on Open
15 DAY Close AVG*- 15 DAY EMA on Close
25 DAY High AVG*- 25 DAY EMA on High
25 DAY Low AVG*- 25 DAY EMA on Low
25 DAY Open AVG*- 25 DAY EMA on open
25 DAY Close AVG*- 25 DAY EMA on Close
15 EMA Signal - If HIGHER HIGHS and HIGHER LOWS on 15 DAY EMA Values then BUY, If LOWER HIGHS and LOWER LOWS on 15 DAY EMA Values then SELL signal. ELSE NO Signal (VOID)
25 EMA Signal*- Same with 25 DAY EMA Values
15 EMA & 25 EMA Signals Combined - IF 15 DAY EMA = BUY and 25 DAY = BUY then BUY....
Final Signal*= Compare Previous Daysignal and then take a final signal...*
For Example if Previous Day = BUY and today = BUY then BUY
For Example if Previous Day = BUY and today = SELL then SELL
For Example if Previous Day = BUY and today = VOID then CLOSE BUY
There are many combinations
Decision based on Signal - We will get a combined signal like "STAY LONG" or "CLOSE LONG and SELL SHORT". So we might have one signal for LONG and another signal for SHORT
LONG Signal*- The Signal for LONG Positions

So at the End of day 02-Sep, we have a LONG Signal called "BUY LONG" and Buy above 5481
On 03-Sep the opening price was 5486 and so we go long ar 5486
On 03-Sep after market opening market made low of 5474 and so our stoploss of 10 points hit. So loss of 10 points on 03-Sep

So at the End of day 03-Sep, we have a LONG Signal called "STAY LONG" above 5483
On 06-Sep the opening price was 5480 and so we go long above 5483 only andso we bough at 5484
On 06-Sep after market opening market made a low of 5480 and so our Stoploss would not have hit.
Market closed around 5577 and so we make a profit of 93 points.

07-Sep is similar to 06-Sep...

Let me know if you have understood, If you know excel a bit, you can see all the formulas used in the calculation....

At the end 03-Sep for 15-DAY EMA Signal, you can obserer that all the Open, High, Low and Close are higher than the previous days values*
5490 > 5487 (High), 5433 > 5427(Low), 5459 > 5455(Open), 5461 > 5458(Close). Since it is making HIGHER HIGHs we get a BUY signal

Same for 25 DAY EMA*
5483 > 5480(High), 5427 > 5423 (Low), 5453 > 5451(Open) , 5455 > 5453 (Close) . Since 25 DAY EMA making Higher HIGHs we get a BUY signal in 25 DAY EMA also...



I tried to write an AFL Based on the above conditions Then I left the process since back results were not so promising

Raj,
If You have any diffrent conditions then let me to know the Calculation details then I will try to modify the AFL


Normally I will Backtest any system for one or two counter. If it give good results then I will check for other counters also.
Saravanan,

The Current OTP tool is based on the Open, Low and High Values.

Simple Rule of Open = Low => Bullish
Open = High => Bearish

The other complex logic works only certain index stocks like NIFTY and BANKNIFTY.

So would it be possible for you to backtest resuls for Open=Low and Open=High with RealTime data at 10 AM (Opening) and compare it with the data at 3:15 PM (Closing)
 

SaravananKS

Well-Known Member
#33
Saravanan,

The Current OTP tool is based on the Open, Low and High Values.

Simple Rule of Open = Low => Bullish
Open = High => Bearish

The other complex logic works only certain index stocks like NIFTY and BANKNIFTY.

So would it be possible for you to backtest resuls for Open=Low and Open=High with RealTime data at 10 AM (Opening) and compare it with the data at 3:15 PM (Closing)
That means Buy @ 10:00 AM if open=Low and hold until 3:15 PM for the stop Loss of Days Low . Am I right ??
 

healthraj

Well-Known Member
#34
Some ways of filtering
- Go for stocks with Small lot size.
- Exclude High Beta Stocks if you cannot take Big risk because High beta stocks normally tend to move beyond the normal Stoploss range. You can look at my StockScreener to find out which are the High beta.
- Take into account VWAP (Volume Waited Average Price). When you are buying buy above VWAP and when you sell, Sell below VWAP.
- You can combine it with the FLOW levels to enter
- Most important Consider the Risk your taking from the Open price because the whole logic is based on the fact that the stock will not trace back to the Open price. So ideally for this kind of trading the Stoploss should be the Open Price. But if the Stock has already moved let us say 1% from the open price then you can avoid this stock.

there might be other ways to filter. But finally it goes without saying that, that is where is the magic, I mean choosing the right stock and choosing the right level to Enter.

This tool only suggests the Stocks to Trade on a particular day based on Open, Low and High. All the values are "Future" values and NOT SPOT.
To add to this based on the data that I had collected for the past one week using the tool, Some of the observations are

1. Stocks with Rating of 7 and 8 are more suitable for the Open=Low and Open=High and do not run often into Stoploss even during the Volatile days (Ofcourse it is not 100%. But the success Ratio is more than 50%.)
2. Trade with lot size = 125, 500, 2000. Avoid 4000. Stocks with 1000 lot size is around 50:50

The above observation is based on the results got in the past one week. so it might be very premature to conclude. So treat it as an observation .

Note: The ratings are based on my other tool "Stock Screener". The rating is basically the Average Range. The higher the range, the higher the rating and volatility.
 

healthraj

Well-Known Member
#35
That means Buy @ 10:00 AM if open=Low and hold until 3:15 PM for the stop Loss of Days Low . Am I right ??
Saravanan, Yes you are absolutely correct. The backtest results would make more sense on Rangebound and Volatile days. For example a day like today where the tool had given 13 bearish calls and 1 bullish call. 3 hit stoploss and the 10 calls gave profits.

But Yesterday for example it was the reverse 17 calls, 3 profits and 14 loss.

One more thing Ideally, The Openprice would be stoploss but we take the call at 10 AM and so we cannot take a lot of risk because from 9:15 to 10 the stock would have run to some values. So our stoploss if based on our openeing price @ 10 AM. But you can also see the success rate with two cases

Case 1: Stoploss @ Open Price
Case 2 : Stoploss @ Our Open price - Risk for Buy , Stoploss @ Our Open price + Risk for Sell

I have also put some additional checks in the VBA code. So if you understand the VBA code I can paste it here. You can also see it in the tool. Otherwise if you want I can write the rules in normal english
 
Last edited:

SaravananKS

Well-Known Member
#36
Saravanan, Yes you are absolutely correct. The backtest results would make more sense on Rangebound and Volatile days. For example a day like today where the tool had given 13 bearish calls and 1 bullish call. 3 hit stoploss and the 10 calls gave profits.

But Yesterday for example it was the reverse 17 calls, 3 profits and 14 loss.

One more thing Ideally, The Openprice would be stoploss but we take the call at 10 AM and so we cannot take a lot of risk because from 9:15 to 10 the stock would have run to some values. So our stoploss if based on our openeing price @ 10 AM. But you can also see the success rate with two cases

Case 1: Stoploss @ Open Price
Case 2 : Stoploss @ Our Open price - Risk for Buy , Stoploss @ Our Open price + Risk for Sell

I have also put some additional checks in the VBA code. So if you understand the VBA code I can paste it here. You can also see it in the tool. Otherwise if you want I can write the rules in normal english
No Problem Raj,
you can paste VBA code that is Better.

I will check with AFL.

only limitation is my RT Data vendors provides only few stocks.


Instead checking all counters I am Planning to back test for some period in a single counter.

if have any idea about some stocks which will work Please mention that stock also
 

SaravananKS

Well-Known Member
#37
To add to this based on the data that I had collected for the past one week using the tool, Some of the observations are

1. Stocks with Rating of 7 and 8 are more suitable for the Open=Low and Open=High and do not run often into Stoploss even during the Volatile days (Ofcourse it is not 100%. But the success Ratio is more than 50%.)
2. Trade with lot size = 125, 500, 2000. Avoid 4000. Stocks with 1000 lot size is around 50:50

The above observation is based on the results got in the past one week. so it might be very premature to conclude. So treat it as an observation .

Note: The ratings are based on my other tool "Stock Screener". The rating is basically the Average Range. The higher the range, the higher the rating and volatility.
For simplicity can we take High Beta Stocks??
 

healthraj

Well-Known Member
#38
For simplicity can we take High Beta Stocks??
I am not sure whether to call it High Beta. The logic i had used to calcualte the rating is as follows.

If the Average Weekly Range > =5% Then Rating = 10
If the Average Weekly Range between 4% and 5% Then Rating = 9
If the Average Weekly Range between 4% and 3% Then Rating = 8
If the Average Weekly Range between 3% and 2.5% Then Rating = 7
Else Rating = 5

So Essentially I am saying select the stocks for which the Average Weekly Range is between 2.5% and 4%.

In my view Stocks with Rating 5 to be avoided because they are not trending and mostly rangebound
Code:
SCRIP	Rating	NIFTY Stock
ABIRLANUVO	5	No
BIOCON	5	No
DIVISLAB	5	No
FEDERALBNK	5	No
IGL	5	No
TATACHEM	5	No
ACC	5	Yes
ASIANPAINT	5	Yes
BAJAJ-AUTO	5	Yes
CAIRN	5	Yes
CIPLA	5	Yes
DRREDDY	5	Yes
GRASIM	5	Yes
HDFCBANK	5	Yes
HINDUNILVR	5	Yes
INFY	5	Yes
ITC	5	Yes
KOTAKBANK	5	Yes
LUPIN	5	Yes
M&M	5	Yes
NTPC	5	Yes
POWERGRID	5	Yes
TATAPOWER	5	Yes
TCS	5	Yes
ULTRACEMCO	5	Yes
BANKNIFTY	5	
NIFTY	5
In my view Stocks with Rating 9 and 10 to be avoided or to be Traded with a Higher STOPLOSS - They are HIGHly Risky
Code:
SCRIP	Rating	NIFTY Stock
CANBK	9	No
CENTURYTEX	9	No
FINANTECH	9	No
JUBLFOOD	9	No
ORIENTBANK	9	No
RAYMOND	9	No
RELCAPITAL	9	No
SIEMENS	9	No
SUNTV	9	No
TITAN	9	No
DLF	9	Yes
RELINFRA	9	Yes
JPASSOCIAT	10	Yes
In my view Stocks with Rating 7 which are LESS Risky
Code:
SCRIP	Rating	NIFTY Stock
COLPAL	7	No
GODREJIND	7	No
HAVELLS	7	No
HINDPETRO	7	No
MCLEODRUSS	7	No
SRTRANSFIN	7	No
TATACOMM	7	No
TECHM	7	No
WIPRO	7	No
AMBUJACEM	7	Yes
BANKBARODA	7	Yes
BPCL	7	Yes
COALINDIA	7	Yes
GAIL	7	Yes
HCLTECH	7	Yes
HDFC	7	Yes
HEROMOTOCO	7	Yes
NMDC	7	Yes
ONGC	7	Yes
RELIANCE	7	Yes
SUNPHARMA	7	Yes
In my view Stocks with Rating 8 which are MEDIUM Risky
Code:
SCRIP	Rating	NIFTY Stock
BANKINDIA	8	No
BATAINDIA	8	No
BHARATFORG	8	No
CESC	8	No
IOC	8	No
JSWSTEEL	8	No
LICHSGFIN	8	No
MCDOWELL-N	8	No
MRF	8	No
OFSS	8	No
RECLTD	8	No
YESBANK	8	No
AXISBANK	8	Yes
BHARTIARTL	8	Yes
BHEL	8	Yes
HINDALCO	8	Yes
ICICIBANK	8	Yes
IDFC	8	Yes
INDUSINDBK	8	Yes
JINDALSTEL	8	Yes
LT	8	Yes
MARUTI	8	Yes
PNB	8	Yes
RANBAXY	8	Yes
SBIN	8	Yes
SESAGOA	8	Yes
TATAMOTORS	8	Yes
TATASTEEL	8	Yes
Please feel free to post your comments. I would also like to know Which are the BEST Stocks to Trade
 

healthraj

Well-Known Member
#39
No Problem Raj,
you can paste VBA code that is Better.

I will check with AFL.

only limitation is my RT Data vendors provides only few stocks.


Instead checking all counters I am Planning to back test for some period in a single counter.

if have any idea about some stocks which will work Please mention that stock also
I would suggest to choose any of the stocks below with Rating 7 or 8 and With Lot size 250, 500 and 2000

So my list would be

With lot size 250
COLPAL
MCDOWELL-N
LT
MARUTI
ICICIBANK
BATAINDIA
RELIANCE

With lot size 500
SRTRANSFIN
PNB
BANKBARODA
HCLTECH
RANBAXY
HAVELLS

With lot size 2000
AMBUJACEM
NMDC
HINDALCO
SESAGOA
IDFC
 

healthraj

Well-Known Member
#40
20-Jun-13 Calls

Please note that I am not trading with all these scrips. It is only for information that I am posting here. Calls were taken around 10:30 AM, because today was a Highly Bearish day and was waiting for a pullback and so delayed by 30 minutes. I have also filtered the stocks with Rating 7 and 8 only

If one had to trade all these calls in Futures (1 lot in Zerodha - Zerodha provides 40% margin on the 10% margin provided by NSE), he/she would need a Margin capital of around Rs 2,10,000 and would have made a profit of around Rs 55,800.

Code:
Date	Time	Stock	Action	Target Price	Profit / Loss	Remarks
20-Jun-13	10:30	AMBUJACEM	SELL	179.35	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	BANKBARODA	SELL	598.55	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	BHARTIARTL	SELL	291.70	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	BHEL	SELL	177.40	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	ICICIBANK	SELL	1047.00	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	IDFC	SELL	139.30	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	LT	SELL	1403.00	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	NMDC	SELL	103.45	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	PNB	SELL	709.90	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	RANBAXY	BUY	356.20	0.00	Opening the call -STRONG BULL
20-Jun-13	10:30	SESAGOA	SELL	140.45	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	BHARATFORG	SELL	213.05	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	MRF	SELL	13925.00	0.00	Opening the call -STRONG BEAR
20-Jun-13	10:30	RECLTD	SELL	200.30	0.00	Opening the call -STRONG BEAR
20-Jun-13	14:44	AMBUJACEM	BUY	179.89	-0.54	Closing the call - Stoploss Triggered - STRONG BEAR
20-Jun-13	14:44	RANBAXY	SELL	355.13	-1.07	Closing the call - Stoploss Triggered - STRONG BULL
20-Jun-13	14:44	BHARATFORG	BUY	213.69	-0.64	Closing the call - Stoploss Triggered - STRONG BEAR
20-Jun-13	14:48	NMDC	BUY	103.15	0.30	Closing the call - Trend Reversed UPwards - STRONG BEAR
20-Jun-13	15:09	BANKBARODA	BUY	577.70	20.85	Closing the call - Manual - STRONG BEAR
20-Jun-13	15:09	BHARTIARTL	BUY	288.10	3.60	Closing the call - Manual - STRONG BEAR
20-Jun-13	15:09	BHEL	BUY	171.30	6.10	Closing the call - Manual - STRONG BEAR
20-Jun-13	15:10	IDFC	BUY	136.50	2.80	Closing the call - Manual - STRONG BEAR
20-Jun-13	15:10	PNB	BUY	687.00	22.90	Closing the call - Manual - STRONG BEAR
20-Jun-13	15:10	RECLTD	BUY	197.10	3.20	Closing the call - Manual - STRONG BEAR
20-Jun-13	15:10	MRF	BUY	13819.90	105.10	Closing the call - Manual - STRONG BEAR
20-Jun-13	15:10	SESAGOA	BUY	139.70	0.75	Closing the call - Manual - STRONG BEAR
20-Jun-13	15:11	LT	BUY	1394.70	8.30	Closing the call - Manual - STRONG BEAR
20-Jun-13	15:11	ICICIBANK	BUY	1045.55	1.45	Closing the call - Manual - STRONG BEAR
Profit/Loss
Code:
Row Labels	BUY	SELL	Profit/Loss
MRF	-1727487.5	1740625	13137.5
PNB	-343500	354950	11450
BANKBARODA	-288850	299275	10425
BHEL	-171300	177400	6100
IDFC	-273000	278600	5600
BHARTIARTL	-288100	291700	3600
RECLTD	-197100	200300	3200
LT	-348675	350750	2075
SESAGOA	-279400	280900	1500
NMDC	-206300	206900	600
ICICIBANK	-261387.5	261750	362.5
RANBAXY	-178100	177565.7	-534.3
BHARATFORG	-213689.15	213050	-639.15
AMBUJACEM	-359776.1	358700	-1076.1
Profit/Loss	-5136665.25	5192465.7	55800.45
 

Similar threads