Auftrag beendet
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Spezifikation
SOLDIERS AND CROWS EA for MT4
I would like an Expert Advisor for MT4 to trade Forex pairs on the 4 HOUR time frame. Basically it hunts sets of three consecutive up bars, or three consecutive down bars. (Three white soldiers or three black crows.)
It only opens positions when no position is currently open on that specific Forex pair. For clarity's sake, it does not add to positions, or negate them, because of new signals in the same, or opposite, direction once a trade is on. It just waits for take profit or stop loss to be hit, and as soon as a trade is closed it begins looking for a new one.
ENTRY TIME PARAMETERS
The EA can only open positions during a specific time window. This should be adjustable. The default should be between 500AM and 1PM EST. So, since it's the 4 hour time frame, the EA will only enter the market at the close of the 100, 500, or 900 bars (meaning at 500, 900, or 1300).
ENTRY PARAMETERS
Long Position (Three White Soldiers)
-BUY at the current price after the close of 3 consecutive up bars. (Buy LONG after any 3 consecutive 4 hour bars that closed higher than they opened, as long as the third bar closed between 500 and 1300 EST, AND no position, long or short, on that pair is currently open.)
Short Position (Three Black Crows)
-SELL at the current price after 3 consecutive down bars. (Sell SHORT after any 3 consecutive bars that closed lower than they opened, as long as the third bar closed between 500 and 1300 EST, AND no position, long or short, on that pair is currently open.)
Note: I know that traditionally the Three White Soldiers/Black Crows patterns insinuate that each bar in the pattern was a strong move. We don't need to worry about that here. I'm just looking for three consecutive bars in either direction. We don't have to define them any more specifically than they closed higher than they opened three bars in row.
TAKE PROFIT AND STOP LOSS
Every trade will have a Take Profit and Stop Loss. Obviously there are no exit time parameters. Stop Loss and Take Profit values are set relative to the ATR(14) (Average True Range with length = 14).
-Stop Loss is equal to the ATR(14) at the time of entry + a small adjustable “Spread” (2 pips default).
-Take Profit is equal to the value of the Stop Loss multiplied by 3 (TP = 3x the ATR(14) at the time of entry + 3x spread).
The risk to reward should be adjustable. The risk will always be the ATR(14) + Spread. So, the only thing adjustable about the risk will be the Spread. The “Reward Ratio” will adjust where the Take Profit is set. The take profit value does not necessarily need to be expressed in terms of the ATR(14). It could simply me a multiple of whatever the Stop Loss is.
VOLUME/ LOT SIZE
EA should calculate lot sizes based on risk for each position. I would like to risk 2% of the current account balance at the time of entry. I would like the value for risk to be expressed in terms of percentage of account balance at entry and I would like that value to be adjustable.
NOTES
Values I would like to be adjustable (default):
-Spread (2pips)
-Entry time window open (500)
-Entry time window close (1300)
-Reward Ratio (3) (The Take Profit = 3( The Stop Loss))
-Risk (2% of the account balance at entry)
-What defines a pip (0.0001 vs 00.01) (If this is necessary ?)
Note: This will be used on JPY and non-JPY pairs. If I need to adjust what a defines a pip for each pair that's not a problem. Just let me know.
Thanks!