Работа завершена
Техническое задание
When the EA is placed on a chart, it should immediately create a horizontal line on the close of the previous candle. This line is the baseline
If this candle is bullish,a buy position of Lot size, L1 is immediately opened.
If this candle is bearish, a sell Position of lot size, L1, is opened.
After the first position is opened, the EA watches to see where the price will go.
Opened Buy Position
1)if the first position is a buy position, and the price goes up X or more pip from the baseline, then closes above X, another horizontal line is created at X and the EA continues to monitor the position. For example, if X=5, and the candle closes 4 pips from the last created line, no line is created at X=4(Bcos, the required value of X is 5) . If the candle closes at 8 pips, a horizontal line is opened at X=5. Please note that for horizontal lines to be created, the price must first close X or more pips from the last created line(i:e, the price must be greater than X and must close above X).Once these conditions are satisfied, the line is then created( not before)
If after opening the buy position, the price then moves down below the baseline then closes X or more pips below it, another horizontal line is created at X and a Sell position of lot size L2 is opened. The position is then monitored.More lines are created X distance from each last line as long as the price moves X or more distance from them
To close a buy position or to open a reverse position, the following conditions must be met: i)The price must open above the last created line, then go below this line and close below it. When this condition is met, the code must then check for the following
i) Is the overall trade( sum of all opened positions), positive i:e are they in profit),a) if the answer is yes, then all opened positions are closed, all old lines are erased, a new line is drawn on the close of the old candle and a Sell position is opened of lot size L1 and the process is repeated again. b)If it is not profitable, the EA must check:
i)If a Sell position has already been opened on this line: a)If a Sell position has already been opened on this line, the EA does nothing but continues to monitor the trade and checks for this condition again when it gets to the next line if the price continues to go down. b)If No Sell position has been opened on this line, the EA opens a Sell position with the next lot size.
Basically, for an open buy position, any time the price opens above a line, then go below this line and close below it. the EA must check for the above-mentioned conditions
Opened Sell Position
2)However, if the first position is a Sell position, and the price goes down X or more pip below the baseline and closes there, the next horizontal line is created at X and the EA continues to monitor the position. For example , if X=5, and the candle closes 4 pips below the last created line( in this case, the baseline), no line is created. If the candle closes at 8 pip below, a horizontal line is opened at X=5.Please note that for horizontal lines to be created, the price must first close X or more pips from the last created line(i:e, the price be greater than X and must close above X.Once this condition are satisfied,the line is then created( not before)
If after opening the Sell position, the price then moves up above the baseline then closes X or more pips above it, another horizontal line is created at X and a Buy position of lot size L2 is opened. The position is then monitored.More lines are created X distance from the last created lines as long as the price moves X or more distance from the it
To close a Sell position and open a reverse position, the following conditions must be met: i)The price must have first opened below the last created, then go above this line and then close above it. When this condition is met, the code must check for the following:
ii) Is the overall trade( sum of all opened positions), positive( i:e in profit), if the answer is yes, then all opened positions are closed, all old lines are erased, a new line is now drawn on the close of the old candle and a buy position is opened of lotsize L1 and the whole process is repeated again. If it is not profitable, the EA must check for the following:
i)If a buy position has already been opened on this line: If a buy position has already been opened on this line, the EA does nothing but continues to monitor the trade. If No Buy position has been opened on this line, the EA opens a buy position with the next lot size.
Basically, for an opened sell position, any time the price opens below a line, then goes above this line and close above it. the EA must check for the above-mentioned conditions
Please note that positions re-opened in an alternative order( i:e a buy than a sell, then another buy, then another sell, e.t.c).There can not be more than one buy or one sell position opened on a line.
In the EA settings tab, create a field to enter the value of X
A)In the EA settings, there should be 25 fields were the lot sizes can be entered. Values for lots size should be entered manually. In a trade, the first position should use the values in the first field, the second position should use the values in the second field, the 3rd position should use the value in the 3rd fields and so on.
B)Create True/False tab in the EA settings, such that if True is enabled, EA should trade continuously, non-stop.If the false button is enabled, then it shouldn't open another trade after a profitable trade is closed.it should be taken off the chart
C)VERY, VERY, IMPORTANT: The EA MUST have continuity and memory. By this I mean, if it is taken off the chart , if any type of interruption takes place, if trading stops on Friday or on holiday, or if for any reason there is an interruption, when the interruption is over, it should immediately recognise all trade it started before the interruption and should continue monitoring it again like there was no interruption. This is very important.
D)Please include a True/False button the in the EA settings tab. If True, The horizontal lines should be visible on the chart.If False, the Horizontal lines should not be visible on the chart.
E)There should be a button in the settings tab for changing the colors of the first line(baseline), the lines above the baseline and the lines below the baseline
F)The EA should be able to work independently of other EA in the same MT4 account. i:e if other EA's are attached to other charts, they must work independently of each other, No interference.
G)Create A dashboard on the top left-hand corner of the chart that displays the following information:
i)Total Buy Positions;
ii)Total Buy Lots
iii)Total Sell Position
iv)Total Sell Lots
v)Profit Loss
vi)Time First Position was opened
vii)EA Status: Connected or Not Connected