Техническое задание
This is a simple channel trading program. However it requires detail and absolute accuracy.
1: The EA is constantly scanning all time frames of selected Forex Pairs in increments of 1 minute up to 1 hour and in 5 min increments after that up to 4 hours. (If this is likely to require too much computing power we can discuss this)
Typically I will be running the major pairs such as EURUSD, EURJPY, GBPUSD, USDJPY, EURGBP but I may run another pair at certain times.
2: All charts for the drawing of lines are kept on the bid price. Channels are drawn in every possible way around the latest candle . For instance if price is falling then all possible down channels are drawn from the edges or wicks as appropriate of previous candles forming a fan around the entry candle. If there are candles surrounding the entry candle as in small bull candles then these are included as well as a small bull channel.
All possible trend lines are drawn in including from wicks to shoulders of candles above if price has been falling or below if price has been rising.
If the closest trend or channel line meets the entry criteria then the system takes the trade. One further trend or channel line can be drawn which is further away than the closest where half of the remaining position left running is closed. We should also have drawn in the trend line and or channel line from the highest point in the last 20, 30, 40, 50 ,60, 70, 80, 90 and 100 candles.
Entry criteria:
No trade is to risk more than 2% of the account size. This is a variable I can adjust. If the system takes more than one trade then no more than 3 trades are to run at any one time.
A: The distance to the closest trend or channel line minus 2 pips is equal to one third or more of the height of the signal candle plus two pips divided by 3. Note that if entry into the trade crosses a trend line or channel line that is fine. IE Distance between channel or trend line is less then one pip. This is measured from the CENTRE of the entry candle at the horizontal level of the top of the signal candle in a buy or the bottom of the signal candle in a sell. Once the signal candle is closed, as soon as the entry candle goes 1 pip above the ask price in a buy or one pip below the bid price in a sell then the system takes the trade with stop loss immediately being set at 1 pip above the ask price in a sell and one pip below the bid price in a buy.
If entry into the trade breaks a trend or channel line ie if a trend or channel line occurs within 1 pip of the entry point then that is fine as the line is broken and not in the way of the trade.
B: Once the entry candle starts and it looks like it could break the top of the signal candle in a buy or the bottom of the signal candle in a sell then a mini channel needs to be drawn between the bottoms of the entry and signal candles and the top (in a buy or the bottom in a sell) of the signal candle. If the distance between top of the signal candle and the mini channel line minus 2 pips is equal to or more than one the height of the signal candle plus 2 pips divided by 3 then system takes the trade, If not then system does not take the trade. The exception is when entry into the trade already passes the mini trend line ie it occurs within 1 pip of the high in a buy or within 1 pip of the low in a sell of the signal candle. Or the entry candle bay be lower than the signal candle in a buy or higher than the signal candle in a sell in which case entry into the trade 1 pip above or below the signal candle has already broken the mini channel line.
VERTICAL DISTANCE IS MEASURED BY MEASURING FROM THE CENTRE OF THE ENTRY CANDLE VERTICALLY UP IN A BUY OR DOWN IN A SELL AT A HORIZONTAL POINT EQUAL to the Ask price of top of the signal candle in a buy or a horizontal point equal to the Bid price of the bottom of the signal candle in a sell. See the attached drawings.
SL is always 1 pips below the bid price of the low of the signal candle. or in a sell SL is 1 pip above the Ask price of the high of the signal candle
Entry is 1 pip above the ask price of the high of the signal candle.Or in a sell it is 1 pip below the bid price of the bottom of the signal candle.
This is an example of the line and parallel line drawing: Not all the lines that are steeper than the entry candle are not drawn in for clarity here but the system itself would drawn them in as each new candle forms. If a line cuts the signal or entry candle before the 1 pip entry criteria is reached then it is fine to take the trade and the line becomes irrelevant.
http://www.screencast.com/users/ConstantineForex/folders/Jing/media/1469a733-3a60-4070-860d-e50e7b5f83b7
Note the single trend line drawn in bold which is from the bottom wick of the candle which is short so difficult to see to its shoulder. These must be drawn in.
Note the parallel flag channel drawn in bold dotted. strictly speaking an extra parallel line should be drawn to the bottom of the bull candle before the flag but here that happens to be the candle with the short trend line in bold.
Here is another example:
http://www.screencast.com/users/ConstantineForex/folders/Jing/media/9aaf208c-9eef-4804-a422-0ced4328c4a8
Note the trend lines in bold are simply a line formed by joining two points which produce a line which could interferer with the trade. It does not require 3 points to be drawn. It is a potential trend line which price needs to test and as such counts as an exclusion criterion if it falls too close to entry point. Also note here there is no trade as there is a channel line too close to the entry point. Look how price responds to it.
Here is a 3rd example:
http://www.screencast.com/users/ConstantineForex/folders/Jing/media/7c9598d1-6ad2-424c-b3e6-fe8d7aa560b9
Here it is the small trend line in bold which negates the trade so it was not taken. Every possible trend and channel line needs to be drawn as long as they DO NOT cut through candles ahead of them and only go round them.
Profit point:
Close one third when price gets to one third the (height of the signal candle plus 2 pips) –note this is not one third of the signal candle in addition to 2 pips it is height of the signal candle plus 2 pips divided by 3.. At this point SL comes to BE minus 2 pips.
Close 80% of the rest of the position remaining when price hits first trend or channel line.
Also Close 10% when price gets to (50%, 75% 100% height of signal candle plus 2 pips).
If first profit is at less than two pips then do not take the trade. If first profit point is between 2-2.9 pips then close 80%. If First profit point is 3-3.9 pips then close 50% . If first profit point is 4 or more pips proceed as above closing one third when price reaches one third the (height of the signal candle plus 2 pips)
If a trend line or channel line is hit BEFORE first profit is taken then do not take profit at that line but move SL to BE minus 2 pips or bottom of the entry candle which ever is lowest and wait until first profit point is hit to close one third of position size.
If a long is taken just below high of the day or a short is taken just below low of the day then the first profit point must be BEFORE high or low of the day. Then at high or low of the day close 50% of the rest of the position.
The attached drawings demonstrate exclusion criteria of
A spike defined as a candle height greater than or equal to 3 x ATR,
A Pin defined as the long tail being at greater than or equal to 1/2 of the total candle height instead of 2/3 I previously specified. In addition if the opposite wick is greater than 5% of the height of the candle then the height of the long wick can be reduced to 45% total height of the candle in order to define a Pin.
A Wedge defined as a 3 push pattern up or down with the 3rd push being within half an ATR of the wedge line either above or below it.
In all 3 cases DO NOT take the first signal generated if there has been no previous break of a low in a sell or break of a high in a buy.
There is also a drawing on drawing mini channels of a flag noting that the first channel line has to be extended to the bottom of the first candle that enters into the flag. THIS MUST NOT BE MISSED.
The same principle applies for all channels as all channels can be flags. Always pull a 3rd parallel line to the bottom of (if flag is going up) or top (if the flag is going down) of the preceding candle entering the flag.
There is also a drawing showing how to draw the mini channel between signal and entry candle with the entry candle starting above or below the signal candle in a buy.
There is also a diagram showing exactly how to measure the distance from entry point from the centre of the entry candle as it rises in a buy above the top of the signal candle or falls in a sell below the bottom of the signal candle to the first trend or channel line.
The system takes a screen shot of every trade when it has completed.
There is an alert generated as soon as the system sees a trade.