Specification
I am developing a web platform that shows all the results what the strategy is having.
I need an EA that collect and publishes strategy data to a remote MySQL database and check for new updates every x configured minutes and if there are new data, publish to the database the new events. The period of time of publising data, timezone of publishing and database configuration must be in EA settings.
When I drop the EA to a chart, it must start collecting ALL DATA that the current account is having every x period of minutes configured, and it need to show in the chart windows the last published statement and statement publish status (same as MyFxBook EA Publisher works).
The data I need to collect is kinda same as MyFxBook API does:
1. Get Current Open Orders.
2. Get Current Open Trades.
3. Get Historical Positions.
4. All other financial data of the strategy.
And with this posted in a database correctly (the bot must create database tables/configuration if it doesn't detect schema config in connected MySQL database), I need a WEB REST API that consults this information, having the following API Methods:
1. total_data: total gain/loss (%), abs gain (%), total pips, total lots, monthly average gain, average drawdown, withdrawals, deposits, total profit, balance, equity, equity percent, demo (true or false), profit factor, fiability, and all other possible data.
2. get_opened_orders: get all the current open orders (each order must return: open time (format: yyyy-mm-dd H:m:s), symbol, order type, lots, open price, tp, sl, ). PARAMETERS: maximim orders to return, and if not defined, show all opened orders.
3. get_opened_trades: get all the current open trades (each order must return: open time (format: yyyy-mm-dd H:m:s), symbol, trade type, lots, open price, tp, sl, profit/loss, pips, swap, etc). PARAMETERS: maximim trades to return, and if not defined, show all opened trades.
4. get_history: get the historical data (every trade here must contain its infromation: opened trade (format: yyyy-mm-dd H:m:s), closed trade (format: yyyy-mm-dd H:m:s), symbol, lots, open price, close price, tp, sl, pips gain/loss, profit gain/loss, interest, etc... PARAMETERS: a range of dates (from x date to x date, format yyyy-mm-dd) and if not defined, show all historical data.
5. get_daily_gain: get all the gain/loss of a day certain given date (returned results: date (format: yyyy-mm-dd), balance of account, PIPs, lots, floating PL, profit, Growth Equity, Floating PIPs). PARAMETERS: desired date in format yyyy-mm-dd.
6. get_custom_gain: get all the gain/loss of a certain range of date (returned results: number of days, pips, lots, floating PL, profit, growth equity, floating pips). PARAMETERS: a range of dates (from x date to x date, format yyyy-mm-dd).
RETURN TYPE: JSON/XML (custom data return must be a param).
I don't want a visual platform, just the API endpoint programmed in PHP.