Skip to content

Commit

Permalink
Merge pull request #31 from zackurben/feature/add-willr-like-technicals
Browse files Browse the repository at this point in the history
Feature/add willr like technicals
  • Loading branch information
zackurben committed Nov 11, 2017
2 parents 4febfbb + 100b5e1 commit 7b4d28a
Show file tree
Hide file tree
Showing 5 changed files with 410 additions and 67 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: node_js
node_js:
- "node"
- "lts/*"

after_script:
- npm run coveralls
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ All contributions are welcome! This is an open source project under the MIT lice
- [x] Add CI/CD support
- [x] Add Sector Performance data
- [ ] Add Technical indicators data
- [ ] Add Forex data
- [ ] Add Crypto currency data
- [x] Add Forex data
- [x] Add Crypto currency data
- [x] Add utils to clean up response data
- [ ] Add better documentation for the sdk functions

Expand Down
21 changes: 20 additions & 1 deletion lib/technical.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,30 @@ module.exports = config => {
rsi: SMA_LIKE('RSI'),
stochrsi: (symbol, interval, time_period, series_type, fastkperiod, fastdperiod, fastdmatype) =>
util.fn('STOCHRSI')({ symbol, interval, time_period, series_type, fastkperiod, fastdperiod, fastdmatype }),
willr: SMA_LIKE('WILLR'),
adx: SMA_LIKE('ADX'),
adxr: SMA_LIKE('ADXR'),
mom: SMA_LIKE('MOM'),
bop: SMA_LIKE('BOP'),
cci: SMA_LIKE('CCI'),
cmo: SMA_LIKE('CMO'),
roc: SMA_LIKE('ROC'),
rocr: SMA_LIKE('ROCR'),
aroon: SMA_LIKE('AROON'),
aroonosc: SMA_LIKE('AROONOSC'),
mfi: SMA_LIKE('MFI'),
trix: SMA_LIKE('TRIX'),
midpoint: SMA_LIKE('MIDPOINT')
dx: SMA_LIKE('DX'),
minus_di: SMA_LIKE('MINUS_DI'),
plus_di: SMA_LIKE('PLUS_DI'),
minus_dm: SMA_LIKE('MINUS_DM'),
plus_dm: SMA_LIKE('PLUS_DM'),
midpoint: SMA_LIKE('MIDPOINT'),
midprice: SMA_LIKE('MIDPRICE'),
trange: SMA_LIKE('TRANGE'),
atr: SMA_LIKE('ATR'),
natr: SMA_LIKE('NATR'),
ad: SMA_LIKE('AD'),
obv: SMA_LIKE('OBV')
};
};
151 changes: 88 additions & 63 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,109 +36,134 @@ const cryptoMarketClose = /4a\. close \(.*\)/g;
* The data keys to replace from the AlphaVantage API.
*/
const keys = {
'Aroon Down': 'down',
'Aroon Up': 'up',
'Meta Data': 'meta',
'Realtime Currency Exchange Rate': 'rate',
'Rank A: Real-Time Performance': 'real',
'Rank B: 1 Day Performance': '1day',
'Rank C: 5 Day Performance': '5day',
'Rank D: 1 Month Performance': '1month',
'Rank E: 3 Month Performance': '3month',
'Rank F: Year-to-Date (YTD) Performance': 'ytd',
'Rank G: 1 Year Performance': '1year',
'Rank H: 3 Year Performance': '3year',
'Rank I: 5 Year Performance': '5year',
'Rank J: 10 Year Performance': '10year',
Information: 'information',
'Last Refreshed': 'updated',
'Time Series (1min)': 'data',
'Time Series (Daily)': 'data',
'Time Series (Digital Currency Intraday)': 'data',
'Time Series (Digital Currency Daily)': 'data',
'Time Series (Digital Currency Weekly)': 'data',
'Time Series (Digital Currency Monthly)': 'data',
'Weekly Time Series': 'data',
'Monthly Time Series': 'data',
'Technical Analysis: SMA': 'data',
'Technical Analysis: EMA': 'data',
'Technical Analysis: WMA': 'data',
'Technical Analysis: DEMA': 'data',
'Technical Analysis: TEMA': 'data',
'Technical Analysis: TRIMA': 'data',
'Technical Analysis: KAMA': 'data',
'Technical Analysis: MAMA': 'data',
'Technical Analysis: T3': 'data',
'Technical Analysis: MACD': 'data',
'Technical Analysis: MACDEXT': 'data',
'Technical Analysis: STOCH': 'data',
'Technical Analysis: STOCHF': 'data',
'Technical Analysis: RSI': 'data',
'Technical Analysis: STOCHRSI': 'data',
'Technical Analysis: WILLR': 'data',
'Technical Analysis: ADX': 'data',
'Technical Analysis: ADXR': 'data',
'Technical Analysis: MOM': 'data',
'Technical Analysis: BOP': 'data',
'Technical Analysis: CCI': 'data',
'Technical Analysis: CMO': 'data',
'Technical Analysis: ROC': 'data',
'Technical Analysis: ROCR': 'data',
'Technical Analysis: AROON': 'data',
'Technical Analysis: AROONOSC': 'data',
'Technical Analysis: MFI': 'data',
'Technical Analysis: TRIX': 'data',
'Technical Analysis: DX': 'data',
'Technical Analysis: MINUS_DI': 'data',
'Technical Analysis: PLUS_DI': 'data',
'Technical Analysis: MINUS_DM': 'data',
'Technical Analysis: PLUS_DM': 'data',
'Technical Analysis: MIDPOINT': 'data',
'Technical Analysis: MIDPRICE': 'data',
'Technical Analysis: TRANGE': 'data',
'Technical Analysis: ATR': 'data',
'Technical Analysis: NATR': 'data',
'Technical Analysis: Chaikin A/D': 'data',
'Technical Analysis: OBV': 'data',
'1. Information': 'information',
'1. From_Currency Code': 'from_currency',
'2. From_Currency Name': 'from_currency_name',
'3. To_Currency Code': 'to_currency',
'4. To_Currency Name': 'to_currency_name',
'5. Exchange Rate': 'value',
Information: 'information',
'1: Symbol': 'symbol',
'1. open': 'open',
'1b. price (USD)': 'usd',
'1b. open (USD)': 'usd_open',
'2b. high (USD)': 'usd_high',
'2. high': 'high',
'2. From_Currency Name': 'from_currency_name',
'2. Symbol': 'symbol',
'2. volume': 'volume',
'2: Indicator': 'indicator',
'2. Digital Currency Code': 'coin',
'3b. low (USD)': 'usd_low',
'2b. high (USD)': 'usd_high',
'3. low': 'low',
'3. To_Currency Code': 'to_currency',
'3. Last Refreshed': 'updated',
'3. Digital Currency Name': 'coin_name',
'3. market cap (USD)': 'cap',
'6. market cap (USD)': 'cap',
'6. Last Refreshed': 'updated',
'Last Refreshed': 'updated',
'4b. close (USD)': 'usd_close',
'3b. low (USD)': 'usd_low',
'4. Output Size': 'size',
'4. To_Currency Name': 'to_currency_name',
'4. close': 'close',
'4. Interval': 'interval',
'4. Market Code': 'market',
'4. Time Zone': 'zone',
'4b. close (USD)': 'usd_close',
'5. adjusted close': 'adjusted',
'5. Exchange Rate': 'value',
'5. Market Name': 'market_name',
'5: Time Period': 'period',
'5. Output Size': 'size',
'5. Time Zone': 'zone',
'5. volume': 'volume',
'5.1: Fast Limit': 'fastlimit',
'5.1: Fast Period': 'fastperiod',
'5.1: FastK Period': 'fastkperiod',
'6.1: FastK Period': 'fastkperiod',
'5.2: Slow Limit': 'slowlimit',
'5.2: Slow Period': 'slowperiod',
'5.2: SlowK Period': 'slowkperiod',
'5.2: FastD Period': 'fastdperiod',
'6.2: FastD Period': 'fastdperiod',
'5.3: Signal Period': 'signalperiod',
'5.3: SlowK MA Type': 'slowkmatype',
'5.3: FastD MA Type': 'fastdmatype',
'6.3: FastD MA Type': 'fastdmatype',
'5.4: Fast MA Type': 'fastmatype',
'5.4: SlowD Period': 'slowdperiod',
'5.5: Slow MA Type': 'slowmatype',
'5.5: SlowD MA Type': 'slowdmatype',
'5.6: Signal MA Type': 'signalmatype',
'6. volume': 'volume',
'6. Time Zone': 'zone',
'6. market cap (USD)': 'cap',
'6. Last Refreshed': 'updated',
'6: Volume Factor (vFactor)': 'volume',
'6: Series Type': 'series',
'6. Interval': 'interval',
'6. Last Refreshed': 'updated',
'6.1: FastK Period': 'fastkperiod',
'6.2: FastD Period': 'fastdperiod',
'6.3: FastD MA Type': 'fastdmatype',
'7: Series Type': 'series',
'4. Output Size': 'size',
'5. Output Size': 'size',
'4. Time Zone': 'zone',
'5. Time Zone': 'zone',
'6. Time Zone': 'zone',
'7. Time Zone': 'zone',
'7. Last Refreshed': 'updated',
'8. Time Zone': 'zone',
'Time Series (1min)': 'data',
'Time Series (Daily)': 'data',
'Time Series (Digital Currency Intraday)': 'data',
'Time Series (Digital Currency Daily)': 'data',
'Time Series (Digital Currency Weekly)': 'data',
'Time Series (Digital Currency Monthly)': 'data',
'Weekly Time Series': 'data',
'Monthly Time Series': 'data',
'Technical Analysis: SMA': 'data',
'Technical Analysis: EMA': 'data',
'Technical Analysis: WMA': 'data',
'Technical Analysis: DEMA': 'data',
'Technical Analysis: TEMA': 'data',
'Technical Analysis: TRIMA': 'data',
'Technical Analysis: KAMA': 'data',
'Technical Analysis: MAMA': 'data',
'Technical Analysis: T3': 'data',
'Technical Analysis: RSI': 'data',
'Technical Analysis: MOM': 'data',
'Technical Analysis: CMO': 'data',
'Technical Analysis: ROC': 'data',
'Technical Analysis: ROCR': 'data',
'Technical Analysis: TRIX': 'data',
'Technical Analysis: MIDPOINT': 'data',
'1. open': 'open',
'2. high': 'high',
'3. low': 'low',
'4. close': 'close',
'5. volume': 'volume',
'6. volume': 'volume',
'5. adjusted close': 'adjusted',
'7. dividend amount': 'dividend',
'8. split coefficient': 'split',
'Rank A: Real-Time Performance': 'real',
'Rank B: 1 Day Performance': '1day',
'Rank C: 5 Day Performance': '5day',
'Rank D: 1 Month Performance': '1month',
'Rank E: 3 Month Performance': '3month',
'Rank F: Year-to-Date (YTD) Performance': 'ytd',
'Rank G: 1 Year Performance': '1year',
'Rank H: 3 Year Performance': '3year',
'Rank I: 5 Year Performance': '5year',
'Rank J: 10 Year Performance': '10year'
'8. Time Zone': 'zone',
'8. split coefficient': 'split'
};

module.exports = config => {
Expand Down

0 comments on commit 7b4d28a

Please sign in to comment.