CREATE TABLE strategie_envelope (
strategie_id INTEGER NOT NULL,
account_id INTEGER NOT NULL,
symbol VARCHAR(100) NOT NULL,
timeframe VARCHAR(5) NOT NULL,
margin_mode VARCHAR(8) NOT NULL,
balance_fraction INTEGER NOT NULL,
leverage INTEGER,
average_type VARCHAR(3) NOT NULL,
average_period INTEGER NOT NULL,
envelopes JSON,
stop_loss_pct DECIMAL,
price_jump_pct DECIMAL,
use_longs BOOLEAN,
use_shorts BOOLEAN,
PRIMARY KEY (strategie_id),
FOREIGN KEY(account_id) REFERENCES accounts (account_id)
)
|
CREATE TABLE `strategie_envelope` (
`strategie_id` int NOT NULL,
`account_id` int NOT NULL,
`symbol` varchar(100) COLLATE utf8mb4_general_ci NOT NULL,
`timeframe` varchar(5) COLLATE utf8mb4_general_ci NOT NULL,
`margin_mode` varchar(8) COLLATE utf8mb4_general_ci NOT NULL,
`balance_fraction` int NOT NULL,
`leverage` int DEFAULT NULL,
`average_type` varchar(3) COLLATE utf8mb4_general_ci NOT NULL,
`average_period` int NOT NULL,
`envelopes` json DEFAULT NULL,
`stop_loss_pct` decimal(4,2) DEFAULT NULL,
`price_jump_pct` decimal(4,2) DEFAULT NULL,
`use_longs` tinyint(1) DEFAULT NULL,
`use_shorts` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`strategie_id`),
KEY `account_id` (`account_id`),
CONSTRAINT `strategie_envelope_ibfk_1` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci |