Would like to get some opinions on this. One of the toughest things I have encountered thus far since trying to automate some of my trading styles in an EA is defining market conditions. I have only been working with metatrader for a couple months now but trading much much longer. I have some EAs that I have created that produce great consistent results in a trending market but fail miserably during ranging and vise versa. So I have been working on trying to define the market and adjust the trading style accordingly. I am going to post two images, one trending and one ranging, with entries shown based on what I have come up with. Exits and money management I haven't considered yet. Want to see if the basic concept will work first. Hopefully I chose the right links to show the images, if not, they should be in the next post.
http://img413.imageshack.us/img413/3...gle1kz7.th.gif
http://img265.imageshack.us/img265/1...gle2dq1.th.gif
The first image is trending. Second is ranging. I used EMA_Angle indicator. Look at the indicator for the settings. The thresholds are different. In a trending market when the bottom indicator is above (or below) it's threshold (turns green or yellow) you buy or sell the opposite threshold break on the top indicator. Look for the arrows in the image. It should be clear there. You will only be trading in one direction when this happens. In a ranging market (bottom image) the bottom indicator has not broken the threshold hence making it red. In that case, you will be taking trades in both directions based on upper or lower threshold breaks on the top indicator. Again, look at the image and it should be clear.
Now, part of the problem I have encountered is the indicator is obviously based on angle and does not define volatility. Therefore cannot define the size of the range. The market can be in large range or small range and have the bottom indicator still be red. The larger the range the higher the threshold needs to be to create optimal entries on the top indicator. Its obviously safer to have a larger threshold. One that accommodates a large range. Gives you good entries on that range and none if the range is too small. A small threshold would put you in both with bad entries on the larger range. So err on the safe side. Or...maybe the threshold is dynamic. It's value is based on ATR. Say a % of daily are multiple of hourly. Maybe both are dynamic. When overall volatility drops, the line defining a trending or ranging market would change. That way entries could be tweaked to a semi trending market. We have all seen it. Trends that go across your monitor at 45 degree angles and trends that are 20 degrees. Both trending though. Having two dynamic thresholds I think would be ideal. Hopefully this all makes sense. That's the basics.
I don't have the ability to code this in an EA and don't really know if it would be worth it anyway. The reason I want opinions. And, no, I have not traded this live or demo for that matter. Just something I have been working on and want opinions before I pursue it further. What benefits do you see, pitfalls, can it coded, can you make it better, do you want to take a shot at coding it, etc.
Thanks for your future input. Bring on the questions. Oh yeah, some of the arrows are slightly off on the images. Entries are at the start of the bar after a confirmed threshold break.
Lonestar
http://img413.imageshack.us/img413/3...gle1kz7.th.gif
http://img265.imageshack.us/img265/1...gle2dq1.th.gif
The first image is trending. Second is ranging. I used EMA_Angle indicator. Look at the indicator for the settings. The thresholds are different. In a trending market when the bottom indicator is above (or below) it's threshold (turns green or yellow) you buy or sell the opposite threshold break on the top indicator. Look for the arrows in the image. It should be clear there. You will only be trading in one direction when this happens. In a ranging market (bottom image) the bottom indicator has not broken the threshold hence making it red. In that case, you will be taking trades in both directions based on upper or lower threshold breaks on the top indicator. Again, look at the image and it should be clear.
Now, part of the problem I have encountered is the indicator is obviously based on angle and does not define volatility. Therefore cannot define the size of the range. The market can be in large range or small range and have the bottom indicator still be red. The larger the range the higher the threshold needs to be to create optimal entries on the top indicator. Its obviously safer to have a larger threshold. One that accommodates a large range. Gives you good entries on that range and none if the range is too small. A small threshold would put you in both with bad entries on the larger range. So err on the safe side. Or...maybe the threshold is dynamic. It's value is based on ATR. Say a % of daily are multiple of hourly. Maybe both are dynamic. When overall volatility drops, the line defining a trending or ranging market would change. That way entries could be tweaked to a semi trending market. We have all seen it. Trends that go across your monitor at 45 degree angles and trends that are 20 degrees. Both trending though. Having two dynamic thresholds I think would be ideal. Hopefully this all makes sense. That's the basics.
I don't have the ability to code this in an EA and don't really know if it would be worth it anyway. The reason I want opinions. And, no, I have not traded this live or demo for that matter. Just something I have been working on and want opinions before I pursue it further. What benefits do you see, pitfalls, can it coded, can you make it better, do you want to take a shot at coding it, etc.
Thanks for your future input. Bring on the questions. Oh yeah, some of the arrows are slightly off on the images. Entries are at the start of the bar after a confirmed threshold break.
Lonestar