指定
Hi
I need an EA that uses two sets of moving averages to execute trades.
One set of moving average will have two moving averages (FAST and SLOW moving averages) and the second sets as well. The moving averages of one set will share the same method but the two sets can use different methods among them.
The EA is to execute trades as follows:
Ø Open a Long trade when the fast moving average of first set crosses above the slow moving average of the same set as long as the number of bars is not more than certain number after cross-over (See point A in the sketch).
Ø The EA is to open only one trade in the same direction (i.e. No more than one Long or short trade at any given point in time).
Ø Close the long trade when the fast moving average of the second set crosses below the slow moving average of the second set (See point C in the sketch).
Ø Open a short trade when the fast moving average of the first set crosses below the slow moving average of the same set as long as the number of bars is not more than a certain number after cross-over (See point B in the sketch).
Ø The Short trade will close when the fast moving average of the second set crosses above the slow moving average of the same set (see point D in the sketch).
Note: Given that fast moving average of set 1 may cross down the slow moving average of the same set before the fast moving average of set 2 crosses down the moving average of set 2; this may prompt opening a short trade whilst the long trade is still open. We will therefore permit opening a short trade before the long trade may have closed and vice versa.
We will need to plot the moving average in different color with the moving average of
the first set ploted as solid lines and moving averages of the second set plotted as Dash lines. Lets use Green for Fast moving average and Red for Slow moving averages.
