BEGIN TRANSACTION;
CREATE TABLE transactionType (
id integer primary key,
description text not null);
INSERT INTO "transactionType" VALUES(1,'BALANCE');
INSERT INTO "transactionType" VALUES(2,'CREDIT');
INSERT INTO "transactionType" VALUES(3,'BUY');
INSERT INTO "transactionType" VALUES(4,'SELL');
INSERT INTO "transactionType" VALUES(5,'BUY STOP');
INSERT INTO "transactionType" VALUES(6,'SELL STOP');
INSERT INTO "transactionType" VALUES(7,'BUY LIMIT');
INSERT INTO "transactionType" VALUES(8,'SELL LIMIT');
CREATE TABLE broker (
id integer primary key,
description text,
currencyPairSet integer not null,
normTimeOffset integer not null,
normTimeStartDate text default '',
normTimeStarTime text default '',
DSTimeOffset integer,
DSTimeStartDate text,
DSTimeStarTime text,
fiveDecimals integer not null);
INSERT INTO "broker" VALUES(1,'Alpari UK',1,1,'1025','0300',2,'0329','0200',1);
INSERT INTO "broker" VALUES(2,'IBFX',2,0,'20091025','0200',1,'20090329','0100',0);
CREATE TABLE currencyPairSet (
id integer primary key,
description text not null);
INSERT INTO "currencyPairSet" VALUES(1,'Standard Lot');
INSERT INTO "currencyPairSet" VALUES(2,'IBFX Mini');
CREATE TABLE currencyPair (
id integer primary key,
description text not null,
setID integer not null);
INSERT INTO "currencyPair" VALUES(1,'USDCHF',1);
INSERT INTO "currencyPair" VALUES(2,'GBPUSD',1);
INSERT INTO "currencyPair" VALUES(3,'EURUSD',1);
INSERT INTO "currencyPair" VALUES(4,'USDJPY',1);
INSERT INTO "currencyPair" VALUES(5,'AUDUSD',1);
INSERT INTO "currencyPair" VALUES(6,'USDCAD',1);
INSERT INTO "currencyPair" VALUES(7,'EURGBP',1);
INSERT INTO "currencyPair" VALUES(8,'EURCHF',1);
INSERT INTO "currencyPair" VALUES(9,'EURJPY',1);
INSERT INTO "currencyPair" VALUES(10,'GBPJPY',1);
INSERT INTO "currencyPair" VALUES(11,'GBPCHF',1);
INSERT INTO "currencyPair" VALUES(12,'EURAUD',1);
INSERT INTO "currencyPair" VALUES(13,'AUDNZD',1);
INSERT INTO "currencyPair" VALUES(14,'USDCHFM',2);
INSERT INTO "currencyPair" VALUES(15,'GBPUSDM',2);
INSERT INTO "currencyPair" VALUES(16,'EURUSDM',2);
INSERT INTO "currencyPair" VALUES(17,'USDJPYM',2);
INSERT INTO "currencyPair" VALUES(18,'AUDUSDM',2);
INSERT INTO "currencyPair" VALUES(19,'USDCADM',2);
INSERT INTO "currencyPair" VALUES(20,'EURGBPM',2);
INSERT INTO "currencyPair" VALUES(21,'EURCHFM',2);
INSERT INTO "currencyPair" VALUES(22,'EURJPYM',2);
INSERT INTO "currencyPair" VALUES(23,'GBPJPYM',2);
INSERT INTO "currencyPair" VALUES(24,'GBPCHFM',2);
INSERT INTO "currencyPair" VALUES(25,'EURAUDM',2);
INSERT INTO "currencyPair" VALUES(26,'AUDNZDM',2);
INSERT INTO "currencyPair" VALUES(27,'EURCAD',1);
INSERT INTO "currencyPair" VALUES(28,'EURCADM',2);
CREATE TABLE ea (
id integer primary key,
description text not null,
magic text);
CREATE TABLE account (
id integer primary key,
description text not null,
broker integer not null);
INSERT INTO "account" VALUES(1,'Live',1);
INSERT INTO "account" VALUES(2,'Demo',1);
CREATE TABLE closedtrade (
ticket integer primary key,
opendatime text,
closedatime text,
transactiontype integer not null,
lot real default 0.0,
currencyPair integer default 0,
currencyPairSet integer default 0,
openprice real default 0.0,
sl real default 0.0,
tp real default 0.0,
closeprice real default 0.0,
rollover real default 0.0,
pl real default 0.0,
comment text,
magic text,
broker integer not null,
account integer not null,
commission real default 0.0);
CREATE TABLE parms (
name text primary key,
value text);
COMMIT;
