View Single Post
 
Old 06-28-2006, 06:26 PM
Aaragorn's Avatar
Aaragorn Aaragorn is offline
Senior Member
 
Join Date: Jun 2006
Location: USA
Posts: 801
Aaragorn is on a distinguished road
help adding indicator as filter and to modify EAs

I have two EA's I want to add a filter too and modify.

I can do my best to explain the rules ...

CHART
first lets set up the chart...
5 minute bar chart candlestick

add one exponential moving average period 5 (on close)
add one exponential moving average period 1 (close)


RAW SIGNAL-this is what the 'whatever' EA and 'EMACROSS' EA is/are currently doing. I want to keep this on the TF of chart it's attached to.

if ema1>ema5 buy when CLOSE1 crosses above EAM5
if ema1<ema5 sell when CLOSE1 crosses below EMA5

This is the raw unfiltered signal. Now we will filter the signal to allow or disallow long or short trades.



FILTER-this is the function that needs to be added to the EA's
(The filter rule is not known what works best yet, the test will reveal what it is to be.)

The filter parameter we want to test and explore is as follows...

add AutoCh indicator on the 30 or 1 hour time frame. Make it able to change TF to something other than the chart the EA is attached to. The channel it shows on the 5m TF is too small.

Using the AutoCh indicator establish the support and resistance lines for the channel. Support line is below the current price point, (bottom line) Resistance line is above the current price point. (top line) Allow the tester to choose how many bars to calculate for the indicator to use.

DISALLOW SELL IF..
We want the filter to disallow sell signals (lets say we set the 'variable1' to 20 pips for starters) which are within 20 pips of the support line (bottom of AutoCh indicator) So anywhere within 20 pips above the lower channel line all we will allow to execute are buy long signals. We will filter out all the sell signals within this proximity to the lower AutoCh indicator line.

so..
if Sell signal occurs <= Support line of AutoCh +20 ....disallow sell trades.

DISALLOW BUY IF..
We want the filter to disallow buy signals which are (lets say we set this 'variable2' to 25 pips for starters) which are within 25 pips of the resistance line (top of the AutoCh indicator) So anywhere within 25 pips below the upper channel line all we will allow to execute are the sell short signals. We will filter out all the buy signals within this proximity to the upper AutoCh indicator line.

so..
if Buy signal occurs => Resistance line of AutoCh -25 ...disallow buy trades.


It would be best to have one 'variable1' for the disallow short and another independent 'variable2' for the disallow long. Trading isn't a perfect symmerty. Often what works for long positions doesn't work as well for short positions so that is why I want to have these independently variable rather than both the same.


The exit rules I like best are what is used in the 'whatever' EA. It uses a trailing stop trigger and a trailing stop. My tests show that this is a very good exit strategy. I would like to see this used on the EMACROSS EA.

If the EMACROSS used the same exit strategy that the 'whatever' ea uses it would be alot more profitable. I have seen it take profit when there was alot more movement to gain. Actually I think it has the potential to be the most profitable of the two EA's if it had both the filter upgrade and the exit strategy of the other program.

The 'whatever' EA needs to be able to enter multiple trades at the same time and tell it how many to allow at once.

That's it.

Don't hesitate to ask if you have questions.
Attached Files
File Type: mq4 EMA_CROSSmodv4.mq4 (11.5 KB, 41 views)
File Type: mq4 whatever.mq4 (2.3 KB, 33 views)
File Type: mq4 ang_AutoCh_HL-v1.mq4 (5.3 KB, 33 views)