https://github.com/mudza09/forex-rates
Javascript plugin for display current forex rates into the DOM, data provided from finnhub.io
https://github.com/mudza09/forex-rates
Last synced: 2 months ago
JSON representation
Javascript plugin for display current forex rates into the DOM, data provided from finnhub.io
- Host: GitHub
- URL: https://github.com/mudza09/forex-rates
- Owner: mudza09
- Created: 2020-03-16T04:08:32.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-16T05:30:57.000Z (over 4 years ago)
- Last Synced: 2025-01-12T14:28:40.391Z (4 months ago)
- Language: JavaScript
- Homepage: https://mudza09.github.io/forex-rates/
- Size: 26.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Forex rates
=========Javascript plugin for display current forex rates into the DOM, data provided from finnhub.io\
See demo : [https://mudza09.github.io/forex-rates/](https://mudza09.github.io/forex-rates/)### HTML markup
Simply create an element that includes the class `forex-rates`
``` html
```
### CSS
Define the styling for up and down conditions
``` css
.forex-rates .price-up {
color: green;
}
.forex-rates .price-down {
color: red;
}
```
### JavaScript
Include this script tag into your HTML, get finnhub api key here : [https://finnhub.io/](https://finnhub.io/)
``` html
forexRates({
apiKey: 'yourfinnhubapikey',
pairs: ['XAUUSD', 'GBPUSD', 'EURUSD']
});
```
### Options
The options you can customize
``` js
forexRates({
apiKey: 'yourfinnhubapikey', // finnhub api key
selector: '.forex-rates', // selector that used display each forex prices
childSelector: 'li', // child selector used, 'li' or 'div' depend your parent selector
pairs: [ // currency pairs
'XAUUSD',
'GBPUSD',
'EURUSD',
'AUDUSD',
'USDCAD',
'USDJPY',
'USDCHF',
'EURGBP'
],
upClass: 'price-up', // css class that used for bullish condition
downClass: 'price-down', // css class that used for bearish condition
resolution: 'D', // candlestick interval '1, 5, 15, 30, 60, D, W, M'
autoReload: false, // set auto reload data every interval time used
interval: 60000 // interval time in miliseconds (default is every 1 minutes)
});
```