Trabajo finalizado
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Tarea técnica
Hi to everyone... I hope you were well.
I want an EA with the following features:
- Must be multi-currency: It can be attached only to a one chart, but it has to be able to operate all the currency included in the input variables.
- The timeframe for each chart has to be set: For example in the declaration of the input variables for the EA, maybe we can put: GBPUSD*M15;AUDCAD*H1; like a text string… this is only one idea, if the programmer see that is easier in other way it can be discussed. The idea whit this is that we can have a config file for the EA to make an easier start, cause this bot will work 15+ currencies.
- It must be able to show a panel with the open trades for each symbol. Account balance and equity.
- In the input variables of risk percentage (with decimals, example: 0.5% or 0.11% can be configured) or fix lots (for this maybe a previous variable of true/false can be configured) or like this:
- It has to had a section that when the EA starts for first time make a revision of all candles of 3 months in the past (no matter the time frame, only 3 months has to be reviewed, for all the currencies and timeframe configured), also the variables of the candle has to be captured by the revision and has to be a section that if the variables comply with an "if" command, draw an horizontal line for the currency. It will be something like this.
for (conditions to read the 3 months in the past, candle by candle, for all the currencies and timeframe configured):
H = high value of the candle
L = Low value of the candle
O = Open value of the candle
C = Close value of the candle
If (conditions to draw the line, you can put any condition, i will change it):
Command line(s) to draw the line (the color of the line can be selected)
When I say to draw a line, I mean this:
Note: the 3 months in the past can be configured in the initial variables, for example each month can be 30 days and if I configure 5 months it will be 5*30=150 days.
- The previous block of code has to be included also in the section for real data (maybe in OnTick() or another event), but each new COMPLETE/PAST candle has to be captured in the same way for past candles like it was performed in step 4. It must be able to capture OHLC values and draw the line.
- For each change of the price (it must be monitoring all time all changes of the price):
a. It must capture the actual bid/ask price for the actual currency (remember that all the previous and following steps must be performed for each configured currency)
b. Include a section that compares the price value with the 2 lines upper and 2 lines below the actual price. For this the capture/obtaining of the lines must be performed (I don't know if this capture of lines drawed can be performed outside the event of each change of price to save computational time). But inside this block I need variables like these:
Up1=price of upper line nearest of the actual price
Up2=price of 2nd upper line nearest of the actual price
Dw1=price of below line nearest of the actual price
Dw2=price of below 2nd line nearest of the actual price
The color of the line must be captured maybe in another variable (UpxC, DwxC)
This is only to compare the actual prices with the lines drawed, like the lines are fixed maybe is more efficient to obtain these values in a mayor loop.
c. Then it must compare the bid/ask price with the price of the lines and the results of this comparation must be a buy or sell action. For example:
If the price is between the Up1 and Up2, a sell position must be placed
If the price is between the Dw1 and Dw2, a buy position must be placed
The SL and TP must be configured (put any rule for this, I'll change it). The configuration of TP must be conditioned to an input variable included in the initial config when the EA is attached, for example a variable Yes/No that works with the configuration of TP
d. After the buy/sell position is performed, must have a section code to change or delete the line (include both, delete action can be commented line in order to use later, I'll complete the code). For example:
If sell position is sent, new Up1 will be the ask price
If buy position is sent, new Dw1 will be the bid price
- A section of trailing SL with only Trailing Step is needed (the quantity in pips of steps can be configured in input variables).
- Last thing is that this code can be backtested, may for backtest the point 5 can be disabled for example in the input variables. I don't know if this can be done in this way, but the backtesting option is a must.