Job finished
Specification
I need an EA that opens trades automatically in the direction of the signal sent by BrainTrend Indicator and close current opened trade that should be in the opposite direction of this new signal. In other words, the EA should reverse trades continuously when BrainTrend indicator sends new signals (blue = BUY and red = SELL) found here: https://www.mql5.com/en/code/395 (also attached mq5 file). You can check the next image to understand what I mean:
The EA can depend on the BrainTrend Indicator or if you prefer or see it simpler, you can add the logic of the indicator to the EA as long as it works in an identical way, with same signals and same input fields.
I should be able to stop the EA manually or it should stop automatically if a fixed amount or percentage of equity or balance is reached.
The EA should be able to trade anything that can be traded in MetaTrader 5 from any broker.
I'd like a GUI (that should be able to be minimized) with the following options:
- Minimum Lot - Show the minimum lot allowed by the server for the currency, index, pair, etc.
- Price per Lot - Show the price in USD per lot for the currency, index, pair, etc.
- Price per Pip - Show the price in USD per Pip for the currency, index, pair, etc. and lot size used
- LOT field - Lot size used for RUN NOW button below for new orders
- BUY ONLY (Buy button green, Sell button red) - EA should open only BUY orders when BrainTrend indicator sends BUY signal and instead of reversing order when BrainTrend send a SELL signal, it should close the BUY order and wait for next BUY order
- SELL ONLY (Buy button red, Sell button green) - EA should open only SELL orders when BrainTrend indicator sends SELL signal and instead of reversing order when BrainTrend send a BUY signal, it should close the SELL order and wait for next SELL order
- BUY & SELL / RUN NOW (Buy button green, Sell button green) - EA should open BUY and SELL orders and reverse orders when opposite direction signal is sent by BrainTrend indicator, if EA was not running and there are no open orders when both BUY and SELL buttons were clicked and changed to green, this option should begin opening an order in the direction of the last BrainTrend indicator signal
- STOP (Buy button red, Sell button red) - EA should stop opening BUY or SELL orders and if there were any open orders when both BUY and SELL were clicked and changed to red, EA should allow any open order to close when opposite direction signal is sent by BrainTrend indicator
The EA should include the following Input fields in the properties:
- Comments field - I can add any type of comment to orders opened in this chart
- Magic Number field - EA should begin with 5 digits corresponding to minutes in chart (00001 for M1, 00060 for H1, 01440 for D1, 10080 for W1, etc.), it should allow any timeframe and then append my custom digits. Example, if EA is in an H1 chart and I choose 8888, the complete magic number should be 000608888
- Lot size - Initial lot size to be used by EA when opening and reversing orders
- Order direction - BUY, SELL, BUY & SELL (dropdown menu) - How this works is in the description above for the GUI
- Open first trade - NOW or NEXT SIGNAL (dropdown menu) - If NOW is selected, EA should open first order immediately in the direction of the lastBrainTrend indicator signal. If NEXT SIGNAL is selected, EA should open first order until the next BrainTrend indicator signal
- Open reverse trades after new indicator signal - IMMEDIATELY, NEXT CANDLE, FIXED SECONDS. If IMMEDIATELY is selected, EA should reverse orders immediately after indicator shows new signal. If NEXT CANDLE is selected, EA should reverse orders when next candle appears after indicator shows new signal. If FIXED SECONDS is selected, EA should reverse order after the seconds filled in the field below.
- Fixed Seconds - (If FIXED SECONDS is chosen above) - EA should reverse order after this amount of seconds
- Protection - BALANCE AMOUNT, BALANCE %, EQUITY AMOUNT, EQUITY % (dropdown menu) - The way the EA will use the amount in the next field to protect the account
- Amount or Percentage (according to selection above) - Example, if BALANCE AMOUNT is selected above and 500 is typed in this field, it means that the EA will do the actions in the below selection if the Balance reaches $500 or if BALANCE % is selected and 50 is entered, same will happen when 50% of balance is reached
- Protection Action - KEEP ORDERS OPEN, LOCK ORDERS, CLOSE ORDERS (drowdown menu) - Action EA should do if balance or equity in settings above is reached
- Protection Action 2: STOP EA, KEEP EA RUNNING (dropdown menu) - Action EA should do if balance or equity in settings above is reached
- Alerts - Enable, Disable
- Email - Enable, Disable
- Push notifications - Enable, Disable
- Sound for Alerts - Enable, Disable
IMPORTANT: EA should manage only the orders it opened in the chart where EA is running and should ignore orders opened in other charts, even if they were also opened by the same EA in that other chart.
I mention this because I've used other EAs that have a "Reverse" option and when selected, it reverses all open orders in MetaTrader, no matter in what currency or in what chart orders were opened.
For example, if I have the EA running for EURUSD in M5, M30 and H1 charts, EA running in M5 chart should only manage EURUSD orders it opened in his own M5 chart and should not touch other EURUSD orders opened by EAs in the M30 and H1 charts, even if they all are the same currency.
I might be adding more features in the future such as trend filters, Telegram notification, etc. so EA should be able to be updated and improved.