Topic: Can one program crossing of 3 EMA's?

wink  wink Hi there

I have a system I would like to test with the Forex Strategy builder. I am having trouble figuring out how, and if it is actually possible. The system is called "System 500" and works as follows:

Three EMA's with following settings:

Period: 2, Method: Exponential, Apply to: Close, Colour: Blue

Period: 4, Method: Exponential, Apply to: Close, Colour: Black

Period: 6, Method: Exponential, Apply to: Close, Colour: Green

Now entry rules are as follows:

For Long positions:

Blue EMA crosses above the Black EMA and is Above the Green EMA on the 4 H chart.
Now check the same pair on the 1 Day chart with the same EMA settings, and IF the 3 EMA's are lined up the same way as on the 4H chart then ENTER Long at the close of the current candle.

This in short is the basic strategy, for Short positions the indicators will be in reverse positions.

Now I know that one can probably not have the Strategy builder, check two separate time frames before an entry, but is it possible to just program it in the builder with the above entry conditions?

I will greatly appreciate somebody helping me with this please.

Regards
Richard

Re: Can one program crossing of 3 EMA's?

Hi Richard,

It can be done! Entry on one TF is below, entry with higher TF reference can be done too, but it needs coding (or copy/pasting in my case as I'm not a real coder), I'll see whether I'm up to the job converting the crossover indi to WTF (wider timeframe).

[Opening Point of the Position]
Bar Closing
     Enter the market at the end of the bar
     Base price  -  Close

[Opening Logic Condition]
Moving Averages Crossover
     [ A ]   The Fast MA crosses the Slow MA upward
     Base price  -  Close
     Fast MA method  -  Exponential
     Slow MA method  -  Exponential
     Fast MA period  -  2
     Slow MA period  -  4
     Fast MA shift  -  0
     Slow MA shift  -  0
     Use previous bar value  -  Yes

[Opening Logic Condition]
Moving Averages Crossover
     [ A ]   The Fast MA is higher than the Slow MA
     Base price  -  Close
     Fast MA method  -  Exponential
     Slow MA method  -  Exponential
     Fast MA period  -  4
     Slow MA period  -  6
     Fast MA shift  -  0
     Slow MA shift  -  0
     Use previous bar value  -  Yes

The rest is up to you - setting strategy properties, closing points, etc.

I'll post the WTF crossover, and the setup if I'm successful!

Re: Can one program crossing of 3 EMA's?

Here is Moving Averages Crossover WTF attached. Please advise if you find bugs.
Workaround for changing colors: use last 2 number parameters to change. The Tool Tip will tell you what number matches what color.
If you use the Optimizer, uncheck them. They do not change the trades.
After a week or so, if no bugs found, I'll post in the WTF thread too.
thanks

Post's attachments

WTF Moving Averages Crossover.cs 26.25 kb, 27 downloads since 2011-05-24 

You don't have the permssions to download the attachments of this post.