작업 종료됨
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
명시
Hello,
I need an indicator or EA (with source code) capable to do the following:
Once is added in the chart has to check in mysql if exist records of that symbol in the database.
In case there is not records has to make INSERT with the next tick and record the information about that tick.
In case there is records because were from before or because the indicator/EA just made the record then has to make UPDATE of the information in that symbol every time MT4 generates a new tick
Has to be capable to reconnect by itself in case the connection with the database was down. Also has to update the information in case the current information in the market doesn't match the one recorded before the connection was lost.
TABLE FORMAT:
CREATE TABLE `ticks` (
`id` int NOT NULL AUTO_INCREMENT, (Single id of the Symbol)
`Symbol` varchar(255) NOT NULL, (Symbol name, example: 'EURUSD')
`Date` date NOT NULL, (Date of the INSERT or last UPDATE)
`Time` datetime NOT NULL, (Datetime of the INSERT or last UPDATE)
`Ask` double NOT NULL, (Ask in the moment of the INSERT or last UPDATE)
`Bid` double NOT NULL, (Bid in the moment of the INSERT or last UPDATE)
`Diff` varchar(255) NOT NULL, (indicate here if the current ASK is higher, lower or equal regarding the previous ASK)
`isopen` varchar(255) NOT NULL, (Days and hours the symbol can de traded)
`swaptype` varchar(255) NOT NULL, (type of swap)
`swaplong` varchar(255) NOT NULL, (swap long)
`swapshort` varchar(255) NOT NULL, (swap short)
`lo` int NOT NULL, (INSERT and UPDATE has to put just this: '-' in this column)
`le` int NOT NULL, (INSERT and UPDATE has to put just this: '-' in this column)
`class` varchar(11) NOT NULL, (INSERT and UPDATE has to put just this: '-' in this column)
`data` varchar(256) NOT NULL, (INSERT and UPDATE has to put just this: '-' in this column)
`askadjust` decimal(10,4) NOT NULL, (INSERT and UPDATE has to put just this: '-' in this column)
`bidadjust` decimal(10,4) NOT NULL, (INSERT and UPDATE has to put just this: '-' in this column)
`sessions` varchar(256) NOT NULL, (INSERT and UPDATE has to put just this: '-' in this column)
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=177 DEFAULT CHARSET=utf8
INPUTS:
Database host, User, Password, Database, Table, Port, Remove prefixes / suffixes (ejemplo is the symbol name is EURUSD.e or e.EURUSD I want to be able to remove the e. or e. part).
Also I need to have a debug area in the chart to show the status of the connection and if the logging in the database is been successful or if is giving errors, take a look in the image for example.
Besides the indicator/expert code the developer has to provide the mqh file the dll files and any other files that are necessary to make the indicator/expert work as expected.