FOUR MOVING AVERAGE CROSSES

 

Hi,

I have been tryin to make an EA on the basis of Four moving averages crosses...using different periods..

during my search i understood the basic idea for two moving average crosses...

could anybody tell how can four or more moving averages crosses can be used to generate buy and sell signal?

Thanks,

Jay!!

 

Why you need to build an EA that you don't know what virtues its signals produce ?

 
cameofx wrote >>

Why you need to build an EA that you don't know what virtues its signals produce ?


So that you can throw it an Strategy Tester and do 8 billion parameter combo optimizations and find THE GRAIL!

lol

 
1005phillip:


So that you can throw it an Strategy Tester and do 8 billion parameter combo optimizations and find THE GRAIL!

lol


Basically the idea is the following.

Main moving average is 232 SMA or whatever on 1H chart, which defines the trend.

Trading takes place on the five minute chart with 5,8,13 or other combinations of MA's the more great the MA, the less frequency of signals

Buy Signal, when 5 crosses 8 and 13 up and Sell when down, exit is done by stop loss, take profit, trailing order,breakeven and 5 crossing 8 in the opposite direction.

Trade is taken only during the american session and not more than 3-5 trades during the session.

Well can now anybody tell me how this can be done, I am able to write two Moving Averages crosses but four need your help.

Thanks!

 

make an array put all the previous values of the ma's in the array and all the current values then compare the array elements

 
SDC:

make an array put all the previous values of the ma's in the array and all the current values then compare the array elements


Sadly...array is the thing that I hate the most...any simple explanation please?
 
Jay007 wrote >>

Sadly...array is the thing that I hate the most...any simple explanation please?


learn to use arrays, arrays are the best part you can do so much with them

they are great for comparing multiple data with other data.

you can write for loops to sweep through the array comparing everything with everything else

i.e. ma lines with other ma lines

 

Yep, learn to program with arrays and learn to program with functions and you'll never regret the time you invested to learn how to do so.

Reason: