Skip to content

Commit

Permalink
feat: new instruments June 2021 (#42)
Browse files Browse the repository at this point in the history
feat: new instruments June 2021
  • Loading branch information
Leo4815162342 committed Jun 27, 2021
1 parent 77f759b commit cf8cf94
Show file tree
Hide file tree
Showing 16 changed files with 244,192 additions and 220 deletions.
84 changes: 51 additions & 33 deletions README.md

Large diffs are not rendered by default.

84 changes: 51 additions & 33 deletions packages/dukascopy-cli/README.md

Large diffs are not rendered by default.

84 changes: 51 additions & 33 deletions packages/dukascopy-node/README.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Expand Up @@ -12,46 +12,49 @@ const saveFile = promisify(fs.writeFile);

const filePath = path.resolve(__dirname, 'generated', 'instruments.md');

const flagMap: Record<string, string> = {
bnd_cfd: '📊',
vccy: '₿',
cmd_agricultural: '☕',
cmd_energy: '⚡',
cmd_metals: '⚙️',
etf_cfd_us: '📈',
fx_crosses: '💱',
fx_majors: '💶',
fx_metals: '🥇',
idx_america: '🌎',
idx_asia: '🌏',
idx_europe: '🌍',
austria: '🇦🇹',
belgium: '🇧🇪',
denmark: '🇩🇰',
finland: '🇫🇮',
france: '🇫🇷',
germany: '🇩🇪',
italy: '🇮🇹',
ireland: '🇮🇪',
netherlands: '🇳🇱',
norway: '🇳🇴',
portugal: '🇵🇹',
spain: '🇪🇸',
sweden: '🇸🇪',
switzerland: '🇨🇭',
japan: '🇯🇵',
'hong-kong': '🇭🇰',
uk: '🇬🇧',
us: '🇺🇸'
const titleMap: Record<string, { emoji: string; title: string }> = {
bnd_cfd: { emoji: '📊', title: 'Bonds' },
vccy: { emoji: '₿', title: 'Crypto assets' },
cmd_agricultural: { emoji: '☕', title: 'Agricultural commodities' },
cmd_energy: { emoji: '⚡', title: 'Energy commodities' },
cmd_metals: { emoji: '⚙️', title: 'Metals commodities' },
etf_cfd_us: { emoji: '🇺🇸📈', title: 'United States ETFs' },
etf_cfd_de: { emoji: '🇩🇪📈', title: 'Germany ETFs' },
etf_cfd_fr: { emoji: '🇫🇷📈', title: 'France ETFs' },
etf_cfd_hk: { emoji: '🇭🇰📈', title: 'Hong Kong ETFs' },
fx_crosses: { emoji: '💱', title: 'Forex currencies' },
fx_majors: { emoji: '💶', title: 'Forex major currencies' },
fx_metals: { emoji: '🥇', title: 'Forex metals' },
idx_america: { emoji: '🌎', title: 'America' },
idx_asia: { emoji: '🌏', title: 'Asia' },
idx_europe: { emoji: '🌍', title: 'Europe' },
austria: { emoji: '🇦🇹', title: 'Austria' },
belgium: { emoji: '🇧🇪', title: 'Belgium' },
denmark: { emoji: '🇩🇰', title: 'Denmark' },
finland: { emoji: '🇫🇮', title: 'Finland' },
france: { emoji: '🇫🇷', title: 'France' },
germany: { emoji: '🇩🇪', title: 'Germany' },
italy: { emoji: '🇮🇹', title: 'Italy' },
ireland: { emoji: '🇮🇪', title: 'Ireland' },
netherlands: { emoji: '🇳🇱', title: 'Netherlands' },
norway: { emoji: '🇳🇴', title: 'Norway' },
portugal: { emoji: '🇵🇹', title: 'Portugal' },
spain: { emoji: '🇪🇸', title: 'Spain' },
sweden: { emoji: '🇸🇪', title: 'Sweden' },
switzerland: { emoji: '🇨🇭', title: 'Switzerland' },
japan: { emoji: '🇯🇵', title: 'Japan' },
'hong-kong': { emoji: '🇭🇰', title: 'Hong Kong' },
uk: { emoji: '🇬🇧', title: 'United Kingdom' },
us: { emoji: '🇺🇸', title: 'United States' }
};

(async () => {
try {
const contentListHeader = '## Instruments\n';
const contentList = instrumentGroups
.map(
({ name, id, instruments }) =>
`* [${name}${flagMap[id] ? ' ' + flagMap[id] : ''} (${instruments.length})](#${id})`
({ id, instruments }) =>
`* [${titleMap[id].title}${titleMap[id].emoji} (${instruments.length})](#${id})`
)
.join('\n');

Expand All @@ -71,8 +74,10 @@ const flagMap: Record<string, string> = {
const divider = headers.map((_, i) => `${!i ? '|' : ''}-|`).join('');

const instrumentTable = instrumentGroups
.map(({ id, name, instruments }) => {
const groupTitle = `<h3 id="${id}">${name} ${flagMap[id] || ''}</h3>\n`;
.map(({ id, instruments }) => {
const groupTitle = `<h3 id="${id}">${titleMap[id].title} ${
titleMap[id].emoji || ''
}</h3>\n`;

const listBody = instruments
.map(instrumentId => {
Expand Down
Expand Up @@ -1056,6 +1056,12 @@ export enum Instrument {
*/
bciteur='bciteur',

/**
* ### Bitcoin Cash vs US dollar
* *BCH/USD*
*/
bchusd='bchusd',

/**
* ### BECTON DICKINSON AND CO
* *BDX.US/USD*
Expand Down Expand Up @@ -3870,6 +3876,12 @@ export enum Instrument {
*/
skygbgbx='skygbgbx',

/**
* ### Standard Life Aberdeen Plc
* *SLA.GB/GBX*
*/
slagbgbx='slagbgbx',

/**
* ### Swiss Life Holding AG
* *SLHN.CH/CHF*
Expand Down Expand Up @@ -4728,6 +4740,12 @@ export enum Instrument {
*/
xlkususd='xlkususd',

/**
* ### Stellar vs US Dollar
* *XLM/USD*
*/
xlmusd='xlmusd',

/**
* ### XILINX INC
* *XLNX.US/USD*
Expand Down
Expand Up @@ -12,9 +12,11 @@
"id": "vccy",
"name": "Crypto",
"instruments": [
"bchusd",
"btcusd",
"ethusd",
"ltcusd"
"ltcusd",
"xlmusd"
]
},
{
Expand Down Expand Up @@ -46,6 +48,33 @@
"coppercmdusd"
]
},
{
"id": "etf_cfd_de",
"name": "Germany",
"instruments": [
"tecdaxedeeur"
]
},
{
"id": "etf_cfd_fr",
"name": "France",
"instruments": [
"dsbfreur",
"lvcfreur",
"lyxbnkfreur"
]
},
{
"id": "etf_cfd_hk",
"name": "Hong Kong",
"instruments": [
"2822hkhkd",
"2828hkhkd",
"2833hkhkd",
"2836hkhkd",
"3188hkhkd"
]
},
{
"id": "etf_cfd_us",
"name": "ETFs",
Expand Down Expand Up @@ -278,7 +307,6 @@
"capfreur",
"csfreur",
"dgfreur",
"dsbfreur",
"edffreur",
"enfreur",
"engifreur",
Expand All @@ -288,8 +316,6 @@
"kerfreur",
"lifreur",
"lrfreur",
"lvcfreur",
"lyxbnkfreur",
"mcfreur",
"orfreur",
"orafreur",
Expand Down Expand Up @@ -341,7 +367,6 @@
"sapdeeur",
"sdfdeeur",
"siedeeur",
"tecdaxedeeur",
"tkadeeur",
"tui1deeur",
"vnadeeur",
Expand Down Expand Up @@ -376,11 +401,6 @@
"2318hkhkd",
"2388hkhkd",
"2628hkhkd",
"2822hkhkd",
"2828hkhkd",
"2833hkhkd",
"2836hkhkd",
"3188hkhkd",
"3333hkhkd",
"3968hkhkd",
"3988hkhkd"
Expand Down Expand Up @@ -697,6 +717,7 @@
"sbrygbgbx",
"sgegbgbx",
"skygbgbx",
"slagbgbx",
"smingbgbx",
"sngbgbx",
"ssegbgbx",
Expand Down

0 comments on commit cf8cf94

Please sign in to comment.