Specification
I need an EA with the following features
- takes the news calendar into account - the robot does not enter the market in a 15 before and after a news release and does not trade at night from 10 p.m. to 4 a.m. (server time)
- on chart buttons/inputs, similar to SAFE EA: https://www.mql5.com/en/market/product/11738
- On/Off (iONOFF) – enable/disable the robot
- Sell (iSELL), Buy(iBUY) – by clicking Sell or Buy buttons, you can enable (green) or disable (red) opening a new order (position)
- x1 (iX2) – first-time lot increase (2-4 times). Any enabling of x1 will increase the lot once again.
- x2 (iX14) – second-time lot increase (4-10 times).
- Coef. lot (iKLOT) – lot ratio (20 000 and higher) for defining the minimum (base) lot for opening a new order: minlot= BalanceValue / Coef. lot
- Pr1 (iPR1), Pr2 (iPR2)– minimum standard order closing points-pips (virtual TP, Pr1 – for a minimum lot, Pr2 – for a increased lot [see x1/x2])
- Drawdown (iDrawdown)– virtual SL in % of the balance (drawdown by funds), at which an order is closed
- Inputs only, not on chart:
- mysql address/ip
- mysql username
- mysql password
- mysql database_name
- mysql insert every x seconds
- mysql select every x seconds
- connect to a MySQL database and do the following steps, once every x seconds (we should be able to configure this as from 0.1 to 100 seconds)
- do a MySQL query: INSERT query with the following values: symbol; date-time; ask price; bid price
- do a MySQL query: SELECT from a table using current symbol; time;
- based on the select result, the robot will:
- open a new order with the SL and TP from the mysql query, using iKLOT (see above)
- if an order already exists; based on mysql query:
- increase order lot size
- close order
- the robot will need to be able to calculate the lot size that will be increased - see x1 / x2. do some tests with SAFE EA to better understand the idea and approximate values
- your feedback, recommendations, experience, support and know-how are highly appreciated as we are doing this experiment for the first time
Some examples on how it will perform:
The robot is installed on multiple pairs and checks+sends data periodically to a MySQL server.
We will have a MySQL table where the robot writes the quotes (ask and bid price) for each pair he's configured on.
Table "market", with the following columns: symbol; datetime (downto microseconds); bid; offer;
datetime= eg: 2015-07-01 00:00:16.919
We will have a MySQL table from where the robot reads what actions needs to do
Table "actions" with the following columns: symbol; datetime (downto seconds); action; predicted; increase
symbol= varchar for identifying a pair, eg: EURUSD
datetime= date and time for the prediction/action, has year-month-day hour-minute-seconds eg: 2015-07-01 00:00:16
action= can have the following values: buy sell wait
predicted= the predicted value of a pair. this value is used if the robot needs to increase the lot size in order to close the trade on profit if the market reaches the predicted value
increase= can have the following numeric values: 0 (do not increase) 1 (increase)
closenegative= can have the following numeric values: 0 (do not close trades) 1 (close trades)
Examples on how it needs to perform:
1. The robot reads from a MySQL table "actions", eg: SELECT * FROM actions WHERE datetime<=DATE_SUB(NOW(), INTERVAL 10 SECOND) AND symbol='EURUSD'
the return from the database, action is: buy
there are no open trades on "EURUSD" buy
the robot opens a new trade on EURUSD, the lot size is calculated using this formula: balance / Coef. lot (iKLOT)
the robot sets stop loss using the Drawdown value
the robot sets take profit using Pr1 value > profit of Pr1 pips
2. The robot reads from a MySQL table "actions"
the return from the database, action is: buy; increase=1
there is an open trade on "EURUSD" buy
the robot increases the lot size and uses the predicted to calculate how much to increase in order to close the trade on profit if the market reaches predicted value, by Pr2 pips
3. The robot reads from a MySQL table "actions"
the return from the database, action is: sell; closenegative=1
there is an open trade on "EURUSD" buy
the robot closes the trade even it it's on loss