Commit 1e232bf3 authored by denis's avatar denis

changed string length for in all tables to 40 (was: 10)

parent 65887986
......@@ -91,7 +91,7 @@ The table can/should be created using the following SQL command:
CREATE TABLE `quotes_daily` (
`date` date NOT NULL,
`daynr` int,
`symbol` char(10) NOT NULL,
`symbol` char(40) NOT NULL,
`open` decimal(16,6),
`high` decimal(16,6),
`low` decimal(16,6),
......@@ -179,7 +179,7 @@ The table can/should be created using the following SQL command:
CREATE TABLE `indicators_daily` (
`date` date NOT NULL,
`daynr` int,
`symbol` char(10) NOT NULL,
`symbol` char(40) NOT NULL,
`HH_short` decimal(16,6),
`LL_short` decimal(16,6),
`HH_mid` decimal(16,6),
......@@ -253,7 +253,7 @@ The table can/should be created using the following SQL command:
CREATE TABLE `ichimoku_daily` (
`date` date NOT NULL,,
`daynr` int,
`symbol` char(10) NOT NULL,
`symbol` char(40) NOT NULL,
`tenkan` decimal(16,6),
`kijun` decimal(16,6),
`chikou` decimal(16,6),
......@@ -314,7 +314,7 @@ The table can/should be created using the following SQL command:
CREATE TABLE `ichimoku_daily_signals` (
`date` date NOT NULL,
`daynr` int,
`symbol` char(10) NOT NULL,
`symbol` char(40) NOT NULL,
`name` char(30),
`type` char(5),
`strength` char(10),
......@@ -381,7 +381,7 @@ This table stores all currently active trades. All signals executed by the execu
The table can/should be created using the following SQL command:
```
CREATE TABLE `portfolio` (
`symbol` char(10) NOT NULL,
`symbol` char(40) NOT NULL,
`markettype` char(6) NOT NULL,
`currency_market` char(3) NOT NULL,
`buyquote_market` decimal(16,6) NOT NULL,
......@@ -462,7 +462,7 @@ The table can/should be created using the following SQL command:
```
CREATE TABLE `orderbook_daily` (
`date` date NOT NULL,
`symbol` char(10) NOT NULL,
`symbol` char(40) NOT NULL,
`type` char(5) NOT NULL,
`buy_sell` char(4) NOT NULL,
`price` decimal(16,6),
......@@ -535,7 +535,7 @@ The table can/should be created using the following SQL command:
CREATE TABLE `stoploss_daily` (
`date` date NOT NULL,
`daynr` int NOT NULL,
`symbol` CHAR(10) NOT NULL,
`symbol` CHAR(40) NOT NULL,
`buydate` date NOT NULL,
`selldate` date,
`sl_type` CHAR(10) NOT NULL,
......@@ -581,7 +581,7 @@ The table can/should be created using the following SQL command:
```
CREATE TABLE `performance_record` (
`date` date NOT NULL,
`symbol` CHAR(11),
`symbol` CHAR(40),
`daynr` int,
`cash` decimal(16,2),
`equity` decimal(16,2),
......
......@@ -238,31 +238,31 @@ void mysql_create_db(char *host, char *username, char *password,\
check_mysql_error(bfromcstr("connect_mysql_database()"), querystring);
// Create table for quotes
querystring=bfromcstr("CREATE TABLE `quotes_daily` (`date` date NOT NULL, `daynr` int, `symbol` char(10) NOT NULL, `open` decimal(16,6), `high` decimal(16,6), `low` decimal(16,6), `close` decimal(16,6), `volume` decimal(16,6), `returns` decimal(16,8), PRIMARY KEY (`date`,`symbol`));");
querystring=bfromcstr("CREATE TABLE `quotes_daily` (`date` date NOT NULL, `daynr` int, `symbol` char(40) NOT NULL, `open` decimal(16,6), `high` decimal(16,6), `low` decimal(16,6), `close` decimal(16,6), `volume` decimal(16,6), `returns` decimal(16,8), PRIMARY KEY (`date`,`symbol`));");
//printf("\n%s", bdata(querystring));
mysql_query(mysql, bdata(querystring));
check_mysql_error(bfromcstr("connect_mysql_database()"), querystring);
// Create table for indicators
querystring=bfromcstr("CREATE TABLE `indicators_daily` ( `date` date NOT NULL, `daynr` int, `symbol` char(10) NOT NULL,`HH_short` decimal(16,6), `LL_short` decimal(16,6), `HH_mid` decimal(16,6),`LL_mid` decimal(16,6),`HH_long` decimal(16,6),`LL_long` decimal(16,6), `HH_atr_period` decimal(16,6), `LL_atr_period` decimal(16,6), `TR` decimal(16,6),`ATR` decimal(16,6), `ADX` decimal(16,6), `regime_filter` decimal(16,6), PRIMARY KEY (`date`,`symbol`));");
querystring=bfromcstr("CREATE TABLE `indicators_daily` ( `date` date NOT NULL, `daynr` int, `symbol` char(40) NOT NULL,`HH_short` decimal(16,6), `LL_short` decimal(16,6), `HH_mid` decimal(16,6),`LL_mid` decimal(16,6),`HH_long` decimal(16,6),`LL_long` decimal(16,6), `HH_atr_period` decimal(16,6), `LL_atr_period` decimal(16,6), `TR` decimal(16,6),`ATR` decimal(16,6), `ADX` decimal(16,6), `regime_filter` decimal(16,6), PRIMARY KEY (`date`,`symbol`));");
//printf("\n%s", bdata(querystring));
mysql_query(mysql, bdata(querystring));
check_mysql_error(bfromcstr("connect_mysql_database()"), querystring);
// Create table for ichimoku indicators
querystring=bfromcstr("CREATE TABLE `ichimoku_daily` (`date` date NOT NULL, `daynr` int, `symbol` char(10) NOT NULL,`tenkan` decimal(16,6),`kijun` decimal(16,6), `chikou` decimal(16,6), `senkou_A` decimal(16,6), `senkou_B` decimal(16,6), `tni` decimal(16,6), PRIMARY KEY (`date`,`symbol`));");
querystring=bfromcstr("CREATE TABLE `ichimoku_daily` (`date` date NOT NULL, `daynr` int, `symbol` char(40) NOT NULL,`tenkan` decimal(16,6),`kijun` decimal(16,6), `chikou` decimal(16,6), `senkou_A` decimal(16,6), `senkou_B` decimal(16,6), `tni` decimal(16,6), PRIMARY KEY (`date`,`symbol`));");
//printf("\n%s", bdata(querystring));
mysql_query(mysql, bdata(querystring));
check_mysql_error(bfromcstr("connect_mysql_database()"), querystring);
// Create table for signals
querystring=bfromcstr("CREATE TABLE `ichimoku_daily_signals` (`date` date NOT NULL, `daynr` int, `symbol` char(10) NOT NULL, `name` char(30), `type` char(5), `strength` char(10), `description` char(60), `amp_info` char(30), `signal_quote` decimal(16,6), `price_quote` decimal(16,6), `executed` bool, PRIMARY KEY (`date`,`symbol`,`name`));");
querystring=bfromcstr("CREATE TABLE `ichimoku_daily_signals` (`date` date NOT NULL, `daynr` int, `symbol` char(40) NOT NULL, `name` char(30), `type` char(5), `strength` char(10), `description` char(60), `amp_info` char(30), `signal_quote` decimal(16,6), `price_quote` decimal(16,6), `executed` bool, PRIMARY KEY (`date`,`symbol`,`name`));");
//printf("\n%s", bdata(querystring));
mysql_query(mysql, bdata(querystring));
check_mysql_error(bfromcstr("connect_mysql_database()"), querystring);
// create table for portfolio
querystring=bfromcstr("CREATE TABLE `portfolio` (`symbol` char(10) NOT NULL, `markettype` char(6) NOT NULL, "
querystring=bfromcstr("CREATE TABLE `portfolio` (`symbol` char(40) NOT NULL, `markettype` char(6) NOT NULL, "
"`currency_market` char(3) NOT NULL, `buyquote_market` decimal(16,6) NOT NULL, "
"`buydate_market` date NOT NULL, `buydaynr_market` int NOT NULL, `buyquote_account` decimal(16,6) NOT NULL,"
"`buydate_account` date NOT NULL, `buydaynr_account` int NOT NULL, `buyquote_signal` decimal(16,6) NOT NULL,"
......@@ -280,7 +280,7 @@ void mysql_create_db(char *host, char *username, char *password,\
check_mysql_error(bfromcstr("connect_mysql_database()"), querystring);
// create table for orderbook
querystring=bfromcstr("CREATE TABLE `orderbook_daily` (`date` date NOT NULL, `symbol` char(10) NOT NULL, `type` char(5) NOT NULL, `buy_sell` char(4) NOT NULL, `price` decimal(16,6), `signalname` char(30) NOT NULL, `cost_per_item` decimal(16,2), `pos_size` decimal(16,2),`quantity` decimal(16,2), `buydate` date, `signaldate` date NOT NULL, `hold_days` int, `comission` decimal(16,2), `stoploss` decimal(16,6), `P_L_total` decimal(16,2), `P_L_piece` decimal(16,2), `P_L_percent` decimal(16,2), `fee` decimal(12,6), PRIMARY KEY (`date`,`signaldate`,`symbol`, `price`, `type`,`buy_sell`, `signalname`));");
querystring=bfromcstr("CREATE TABLE `orderbook_daily` (`date` date NOT NULL, `symbol` char(40) NOT NULL, `type` char(5) NOT NULL, `buy_sell` char(4) NOT NULL, `price` decimal(16,6), `signalname` char(30) NOT NULL, `cost_per_item` decimal(16,2), `pos_size` decimal(16,2),`quantity` decimal(16,2), `buydate` date, `signaldate` date NOT NULL, `hold_days` int, `comission` decimal(16,2), `stoploss` decimal(16,6), `P_L_total` decimal(16,2), `P_L_piece` decimal(16,2), `P_L_percent` decimal(16,2), `fee` decimal(12,6), PRIMARY KEY (`date`,`signaldate`,`symbol`, `price`, `type`,`buy_sell`, `signalname`));");
//printf("\n%s", bdata(querystring));
mysql_query(mysql, bdata(querystring));
check_mysql_error(bfromcstr("connect_mysql_database()"), querystring);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment