Augubhai's ORB System

myamit

Well-Known Member
#21
Amit, thanks for posting the chart. This will really help people to "see" the method.

I do not have the historical data for these dates, but I am guessing that these were dates on which there was no opening range breakout in the first 25 minutes.
Hope this explanation is clear. The Opening Range is the most important concept in any ORB method. It is simple stuff, but maybe the way that I am explaining makes it sound complex.
Yes, your assumption is correct. Also thank you for such detailed explanation. Based upon your explanation & with some back testing.. I have tweaked your system a little (you can say I've customized for Nifty). Also I've tried to achieve effective results with two basic thoughts...
- keep small SL (to limit my upfront loss)
- have more winning trades (to keep one motivated to continue using this system)

Following changes has yielded excellent results...

EntryTimeStart has been changed to 30. So Opening Range to watch would be 30 minutes.

EntryTimeEnd has been changed to 150. So now you can enter in trade in first 3 hours (30 minute range & 150 minutes of trade entry time)

Initial SL has been kept as below i.e. if range is greater than 20 than other side of range + 9 point filter. If range is lower than 20 than 18 points stop loss.


The other side of range is not something that I have seriously considered. The reason is that on some days the range is very narrow, and a small pullback will hit your stop loss. On other days, the range can be very wide, increasing the risk. If we want to use the other side of range, then it will be good to avoid trades on days when the range is very narrow or very wide. Just my thoughts, but I have not evaluated seriously.
I've tried to address your above concern with following code.

Code:
ORBDiff = ORBH - ORBL ; 

ORBTooHigh = 50; //Optimize("ORBTooHigh", 50, 30, 60, 1);
ORBTooLow = 10; //Optimize("ORBTooLow", 10, 10, 20, 1);

SLNum = 6; //Optimize("SLNum", 6, 1, 20, 1);

ORBHSL=IIf(ORBDiff > ORBTooLow , ORBL - SLNum, ORBH - (SLNum * 2)); 
ORBHSL=IIf(ORBDiff < ORBTooHigh , ORBL - SLNum, ORBH - (SLNum * 2)); 

ORBLSL=IIf(ORBDiff > ORBTooLow , ORBH + SLNum, ORBH + (SLNum * 2)); 
ORBLSL=IIf(ORBDiff < ORBTooHigh, ORBH + SLNum, ORBH + (SLNum * 2)); 

ProfitPoints = 140; //Optimize("ProfitPoints0", 140, 40, 160, 5);
ORBHTarget = ORBH + ProfitPoints ; 
ORBLTarget = ORBL - ProfitPoints ; 

TRStop = 45; //Optimize("TrailingStop", 45, 25, 80,1);
ApplyStop(stopTypeTrailing, stopModePoint, TRStop, 1, False, 0);

SetPositionSize(100, spsShares);
As always, your views are important & will surely be a help to improve this system. Thank you.
 

lasty66

Active Member
#22
Amit, thanks for posting the chart. This will really help people to "see" the method.



I do not have the historical data for these dates, but I am guessing that these were dates on which there was no opening range breakout in the first 25 minutes. I am assuming that you did not change the default parameters in my code while creating the chart.

In my code, I have set the default values of EntryTimeStart as 5 minutes, and EntryTimeEnd as 25 minutes.

EntryTimeStart is the period that is considered for the Opening Range. So if the EntryTimeStart is 5 minutes, the High and Low at the end of the first 5 minutes of trading will define the Opening Range for the day. Whenever, price goes above the High+Buffer, we Buy. Similarly, if price goes below the Low-Buffer, we Sell.

Hope this explanation is clear. The Opening Range is the most important concept in any ORB method. It is simple stuff, but maybe the way that I am explaining makes it sound complex.

I have also used a parameter EntryTimeEnd. The default value is 25 minutes, which means that if the price does not break out of the Opening Range (above the High+Buffer or below Low-Buffer) within the first 25 minutes of trading, we will not trade on that day. I am guessing that this is what happened on the dates that you mentioned. Most of the times, if the range is not broken within the first hour or so, if may just turn out to be a range-bound day and not very profitable. Just my observation on a few days - but I have also seen many exceptions.

You can change the value of EntryTimeStart, EntryTimeEnd and other parameters by right clicking on the chart and selecting "Parameters".



Yes. that was the election result day. We would not have been in a position to trade this method on that day.


EntryBarStart is the bar corresponding to the EntryTimeStart, and EntryBarEnd is the bar corresponding to the EntryTimeEnd


The other side of range is not something that I have seriously considered. The reason is that on some days the range is very narrow, and a small pullback will hit your stop loss. On other days, the range can be very wide, increasing the risk. If we want to use the other side of range, then it will be good to avoid trades on days when the range is very narrow or very wide. Just my thoughts, but I have not evaluated seriously.


As I mentioned, the inspiration for this method came from Dhiraj's 2652 method, where you take the trade in the opposite direction if the Stop Loss is hit. I did consider a similar approach, but did not evaluate it rigorously. This single breakout method itself is profitable enough.



Whew! I think this is the longest post that I have ever written.
Thanks Augubhai.....
I have 2 simple queries..
1) what do the Green/Red 'hollow' arrow and the Green/Red 'opaque(bold)' arrows signify?
2) What are re-entry rules incase SL is hit?

thanks
 

lasty66

Active Member
#23
Yes, your assumption is correct. Also thank you for such detailed explanation. Based upon your explanation & with some back testing.. I have tweaked your system a little (you can say I've customized for Nifty). Also I've tried to achieve effective results with two basic thoughts...
- keep small SL (to limit my upfront loss)
- have more winning trades (to keep one motivated to continue using this system)

Following changes has yielded excellent results...

EntryTimeStart has been changed to 30. So Opening Range to watch would be 30 minutes.

EntryTimeEnd has been changed to 150. So now you can enter in trade in first 3 hours (30 minute range & 150 minutes of trade entry time)

Initial SL has been kept as below i.e. if range is greater than 20 than other side of range + 9 point filter. If range is lower than 20 than 18 points stop loss.




I've tried to address your above concern with following code.

Code:
ORBDiff = ORBH - ORBL ; 

ORBTooHigh = 50; //Optimize("ORBTooHigh", 50, 30, 60, 1);
ORBTooLow = 10; //Optimize("ORBTooLow", 10, 10, 20, 1);

SLNum = 6; //Optimize("SLNum", 6, 1, 20, 1);

ORBHSL=IIf(ORBDiff > ORBTooLow , ORBL - SLNum, ORBH - (SLNum * 2)); 
ORBHSL=IIf(ORBDiff < ORBTooHigh , ORBL - SLNum, ORBH - (SLNum * 2)); 

ORBLSL=IIf(ORBDiff > ORBTooLow , ORBH + SLNum, ORBH + (SLNum * 2)); 
ORBLSL=IIf(ORBDiff < ORBTooHigh, ORBH + SLNum, ORBH + (SLNum * 2)); 

ProfitPoints = 140; //Optimize("ProfitPoints0", 140, 40, 160, 5);
ORBHTarget = ORBH + ProfitPoints ; 
ORBLTarget = ORBL - ProfitPoints ; 

TRStop = 45; //Optimize("TrailingStop", 45, 25, 80,1);
ApplyStop(stopTypeTrailing, stopModePoint, TRStop, 1, False, 0);

SetPositionSize(100, spsShares);
As always, your views are important & will surely be a help to improve this system. Thank you.
Thanks myamit,

where do we put this code? in the original augubhai's afl?:confused:
 

augubhai

Well-Known Member
#24
Yes, your assumption is correct. Also thank you for such detailed explanation. Based upon your explanation & with some back testing.. I have tweaked your system a little (you can say I've customized for Nifty). Also I've tried to achieve effective results with two basic thoughts...
- keep small SL (to limit my upfront loss)
- have more winning trades (to keep one motivated to continue using this system)

Following changes has yielded excellent results...

EntryTimeStart has been changed to 30. So Opening Range to watch would be 30 minutes.

EntryTimeEnd has been changed to 150. So now you can enter in trade in first 3 hours (30 minute range & 150 minutes of trade entry time)

Initial SL has been kept as below i.e. if range is greater than 20 than other side of range + 9 point filter. If range is lower than 20 than 18 points stop loss.




I've tried to address your above concern with following code.

Code:
ORBDiff = ORBH - ORBL ; 

ORBTooHigh = 50; //Optimize("ORBTooHigh", 50, 30, 60, 1);
ORBTooLow = 10; //Optimize("ORBTooLow", 10, 10, 20, 1);

SLNum = 6; //Optimize("SLNum", 6, 1, 20, 1);

ORBHSL=IIf(ORBDiff > ORBTooLow , ORBL - SLNum, ORBH - (SLNum * 2)); 
ORBHSL=IIf(ORBDiff < ORBTooHigh , ORBL - SLNum, ORBH - (SLNum * 2)); 

ORBLSL=IIf(ORBDiff > ORBTooLow , ORBH + SLNum, ORBH + (SLNum * 2)); 
ORBLSL=IIf(ORBDiff < ORBTooHigh, ORBH + SLNum, ORBH + (SLNum * 2)); 

ProfitPoints = 140; //Optimize("ProfitPoints0", 140, 40, 160, 5);
ORBHTarget = ORBH + ProfitPoints ; 
ORBLTarget = ORBL - ProfitPoints ; 

TRStop = 45; //Optimize("TrailingStop", 45, 25, 80,1);
ApplyStop(stopTypeTrailing, stopModePoint, TRStop, 1, False, 0);

SetPositionSize(100, spsShares);
As always, your views are important & will surely be a help to improve this system. Thank you.
Same thoughts as mine. I need these 2 - small SL, and more wins - just to get the confidence to trade, even if it results in a small reduction in profit.

In realtime trading, I do use Trailing Stops, just to avoid the heart break of seeing a profitable position turn negative, even if that reduces some profit over the long term. (I have not put in the AFL. The first version of the AFL that I posted was written in 2009 and not been touched since. Actually, I had completed my backtesting of this ORB method by running perl scripts on intraday data, even before I got introduced to Amibroker. Maybe I will add the code for the Trailing STop also into the method when I get time)

The other thought that I have is to reduce large whipsaws. A large whipsaw just saps the confidence to trade even profitable systems.

Appreciate that you are tweaking the system for better result. That was my whole objective in posting the afl - that someone can analyze the performance of Opening Range Breakout better.

Just 1 point - EntryTimeEnd = 150 will enter trades only within the first 2.5 hours. For 3 hours, it should be EntryTimeEnd = 180.

From my experience on Nifty, I think an early entry is good, the earlier the better. That will get you most profit on nice trending days. 30 minutes is a reasonable & profitable timeframe for the ORB. These observations were without the tweaks that you have done. With your changes, the results could be different.

I have also tried this system on MCX commodities like Crude & Copper and not been profitable. Maybe I just did not tweak it right...
 

augubhai

Well-Known Member
#25
Thanks Augubhai.....
I have 2 simple queries..
1) what do the Green/Red 'hollow' arrow and the Green/Red 'opaque(bold)' arrows signify?
2) What are re-entry rules incase SL is hit?

thanks
Green opaque up arrow indicates a long entry
Green opaque down arrow indicates exit from long position
Red opaque down arrow indicates a short entry
Red opaque up arrow indicates exit from short position
Hollow Green arrow indicates long entry and exit on the same bar
Hollow Red arrow indicates short entry and exit on the same bar
 

linkon7

Well-Known Member
#26
While trading the opening range... few things needs to be considered to gain maximum benefit from trading OBR...

1. The range of the previous day and location of today's first five minutes in respect to that range.
2. Gap up / down. small gaps has a bigger chance of being filled. Large gaps normally are trend continuation.
3. The size of the first 30 min bar range.. if its wide, then chances are we will have a neutral day with very little range extension. If the range is narrow, then chances are, we will have 2x or 3x range extension and day can develop into a strong trending day.
4. Prevailing trend.
5. Key levels that market tends to respect.
6. any news that might be declared during market hours.
7. type of previous day. If we had a huge movement the day before with price closing at one extreame, then chances are we will see profit booking if we gap in the same direction. then a small pause that might lead to consolidation.

In short, playing OBR needs a basic understanding of market structure.... but if done correctly, first 45 min of the day is all you need to fill your day's target....
 

lasty66

Active Member
#27
Green opaque up arrow indicates a long entry
Green opaque down arrow indicates exit from long position
Red opaque down arrow indicates a short entry
Red opaque up arrow indicates exit from short position
Hollow Green arrow indicates long entry and exit on the same bar
Hollow Red arrow indicates short entry and exit on the same bar
Thanks Augubhai...
whats the stoploss u keep on a 5 min charts... and your re-entry rules? :)
 

augubhai

Well-Known Member
#28
Thanks Augubhai...
whats the stoploss u keep on a 5 min charts... and your re-entry rules? :)
Hi Lasty. I do not re-enter. Stop Loss I keep between 1-2 % for Nifty - it varies. Sometimes I even go for lower values. Towards the last 30 minutes of trading, I bring the Stop Loss closer and closer till the position is closed. If there is good move in my favor, I trail the stop loss to below/above points where price paused.
 

augubhai

Well-Known Member
#29
While trading the opening range... few things needs to be considered to gain maximum benefit from trading OBR...

1. The range of the previous day and location of today's first five minutes in respect to that range.
2. Gap up / down. small gaps has a bigger chance of being filled. Large gaps normally are trend continuation.
3. The size of the first 30 min bar range.. if its wide, then chances are we will have a neutral day with very little range extension. If the range is narrow, then chances are, we will have 2x or 3x range extension and day can develop into a strong trending day.
4. Prevailing trend.
5. Key levels that market tends to respect.
6. any news that might be declared during market hours.
7. type of previous day. If we had a huge movement the day before with price closing at one extreame, then chances are we will see profit booking if we gap in the same direction. then a small pause that might lead to consolidation.

In short, playing OBR needs a basic understanding of market structure.... but if done correctly, first 45 min of the day is all you need to fill your day's target....
Linkon, helpful pointers from you to improve the system. Thanks... I have not been able to trade this system successfully with MCX commodities. I will see if I take the market structure into account to trade successfully in commodities with this system.

For Nifty, the system is profitable even without looking at the market structure. Maybe looking at the structure may make it more profitable. All on my to-do list - don't know when I will get to it though.
 

Similar threads