From 025cff83ef81cabfdb807ff7ed56ef2294f2def7 Mon Sep 17 00:00:00 2001 From: Torrey Leonard Date: Thu, 28 Feb 2019 19:14:33 -0500 Subject: [PATCH] Updated docs --- docs/DATA.md | 52 +++++++++++++++++++++++++++++ docs/ROBINHOOD.md | 85 ++++++++++++++++++++++++++--------------------- 2 files changed, 100 insertions(+), 37 deletions(-) diff --git a/docs/DATA.md b/docs/DATA.md index c6b0ea3..d7515a3 100755 --- a/docs/DATA.md +++ b/docs/DATA.md @@ -54,6 +54,9 @@ Further documentation can be found here: https://www.alphavantage.co/documentati * [.rsi(symbol, interval, timePeriod, seriesType)](#AlphaVantage+rsi) ⇒ Promise.<Array> * [.stochRSI(symbol, interval, timePeriod, seriesType, fastKPeriod, fastDPeriod, fastDmaType)](#AlphaVantage+stochRSI) ⇒ Promise.<Array> * [.bbands(symbol, interval, timePeriod, seriesType, nbdevup, nbdevdn, matype)](#AlphaVantage+bbands) ⇒ Promise.<Array> + * [.minus_di(symbol, interval, timePeriod)](#AlphaVantage+minus_di) ⇒ Promise.<Array> + * [.plus_di(symbol, interval, timePeriod)](#AlphaVantage+plus_di) ⇒ Promise.<Array> + * [.adx(symbol, interval, timePeriod)](#AlphaVantage+adx) ⇒ Promise.<Array> @@ -402,6 +405,48 @@ https://www.investopedia.com/articles/technical/04/030304.asp | nbdevdn | Number \| Null | The standard deviation multiplier of the lower band. Positive integers are accepted. By default, nbdevdn=2. | | matype | Number \| Null | Moving average type of the time series. By default, matype=0. Integers 0 - 8 are accepted with the following mappings. 0 = Simple Moving Average (SMA), 1 = Exponential Moving Average (EMA), 2 = Weighted Moving Average (WMA), 3 = Double Exponential Moving Average (DEMA), 4 = Triple Exponential Moving Average (TEMA), 5 = Triangular Moving Average (TRIMA), 6 = T3 Moving Average, 7 = Kaufman Adaptive Moving Average (KAMA), 8 = MESA Adaptive Moving Average (MAMA). | + + +### alphaVantage.minus\_di(symbol, interval, timePeriod) ⇒ Promise.<Array> +This API returns the minus directional indicator (MINUS_DI) values +http://www.investopedia.com/articles/technical/02/050602.asp + +**Kind**: instance method of [AlphaVantage](#AlphaVantage) + +| Param | Type | Description | +| --- | --- | --- | +| symbol | String | | +| interval | String | Time between two data points in the series: 1min, 5min, 15min, 30min, 60min, daily, weekly, monthly | +| timePeriod | Number | Number of data points used to calculate each moving average value. Positive integers are accepted. | + + + +### alphaVantage.plus\_di(symbol, interval, timePeriod) ⇒ Promise.<Array> +This API returns the plus directional indicator (PLUS_DI) values +http://www.investopedia.com/articles/technical/02/050602.asp + +**Kind**: instance method of [AlphaVantage](#AlphaVantage) + +| Param | Type | Description | +| --- | --- | --- | +| symbol | String | | +| interval | String | Time between two data points in the series: 1min, 5min, 15min, 30min, 60min, daily, weekly, monthly | +| timePeriod | Number | Number of data points used to calculate each moving average value. Positive integers are accepted. | + + + +### alphaVantage.adx(symbol, interval, timePeriod) ⇒ Promise.<Array> +This API returns the average directional movement index (ADX) values +http://www.investopedia.com/articles/trading/07/adx-trend-indicator.asp + +**Kind**: instance method of [AlphaVantage](#AlphaVantage) + +| Param | Type | Description | +| --- | --- | --- | +| symbol | String | | +| interval | String | Time between two data points in the series: 1min, 5min, 15min, 30min, 60min, daily, weekly, monthly | +| timePeriod | Number | Number of data points used to calculate each ADX value. Positive integers are accepted | + ## IEX @@ -410,6 +455,7 @@ Used to interact with the IEX api. See the official documentation for more: http **Kind**: global class * [IEX](#IEX) + * [.getMarket()](#IEX.getMarket) ⇒ Promise.<Market> * [.getQuote(symbol)](#IEX.getQuote) ⇒ Promise.<Quote> * [.getBatchQuotes(symbolArray)](#IEX.getBatchQuotes) ⇒ Promise.<Array.<Quote>> * [.getCompanyDetails(symbol)](#IEX.getCompanyDetails) ⇒ Promise.<Object> @@ -424,6 +470,12 @@ Used to interact with the IEX api. See the official documentation for more: http * [.getVolumeByVenue(symbol)](#IEX.getVolumeByVenue) ⇒ Promise.<Array.<String>> * [.getAllSymbols()](#IEX.getAllSymbols) ⇒ Promise.<Array.<Object>> + + +### IEX.getMarket() ⇒ Promise.<Market> +Returns a market object. + +**Kind**: static method of [IEX](#IEX) ### IEX.getQuote(symbol) ⇒ Promise.<Quote> diff --git a/docs/ROBINHOOD.md b/docs/ROBINHOOD.md index c6fed1d..f9da483 100755 --- a/docs/ROBINHOOD.md +++ b/docs/ROBINHOOD.md @@ -1222,14 +1222,15 @@ Represents the user that is logged in while accessing the Robinhood API. * [User](#User) * [new User(username, password)](#new_User_new) * _instance_ - * [.authenticate(password, mfaFunction)](#User+authenticate) ⇒ Promise.<Boolean> + * [.authenticate(password, mfaFunction)](#User+authenticate) ⇒ [Promise.<User>](#User) + * [.reauthenticate()](#User+reauthenticate) ⇒ [Promise.<User>](#User) * [.logout()](#User+logout) ⇒ Promise.<Boolean> + * [.serialize()](#User+serialize) ⇒ string * [.save()](#User+save) ⇒ Promise.<Boolean> - * [.serialize()](#User+serialize) ⇒ String - * [.isAuthenticated()](#User+isAuthenticated) ⇒ Boolean - * [.getAuthToken()](#User+getAuthToken) ⇒ String \| Null - * [.getAccountNumber()](#User+getAccountNumber) ⇒ String \| Null - * [.getUsername()](#User+getUsername) ⇒ String \| Null + * [.isAuthenticated()](#User+isAuthenticated) ⇒ boolean + * [.getAuthToken()](#User+getAuthToken) ⇒ null \| string + * [.getAccountNumber()](#User+getAccountNumber) ⇒ null \| string + * [.getUsername()](#User+getUsername) ⇒ null \| string * [.getAccount()](#User+getAccount) ⇒ Promise * [.getBalances()](#User+getBalances) ⇒ Promise.<Object> * [.getBuyingPower()](#User+getBuyingPower) ⇒ Promise @@ -1250,8 +1251,9 @@ Represents the user that is logged in while accessing the Robinhood API. * [.getDocuments()](#User+getDocuments) ⇒ Promise.<Array> * [.downloadDocuments(folder)](#User+downloadDocuments) ⇒ Promise * _static_ + * [.deserialize(data)](#User.deserialize) ⇒ [Promise.<User>](#User) * [.load()](#User.load) ⇒ [Promise.<User>](#User) - * [.deserialize()](#User.deserialize) ⇒ [Promise.<User>](#User) + * [.isUser(object)](#User.isUser) ⇒ boolean @@ -1266,7 +1268,7 @@ Creates a new User object. -### user.authenticate(password, mfaFunction) ⇒ Promise.<Object> +### user.authenticate(password, mfaFunction) ⇒ [Promise.<User>](#User) Authenticates a user using the inputted username and password. **Kind**: instance method of [User](#User) @@ -1278,59 +1280,55 @@ Authenticates a user using the inputted username and password. -### user.reauthenticate() ⇒ Promise.<Object> -Re-authenticates a user using the refresh token. -**Kind**: instance method of [User](#User) - -| Param | Type | Description | -| --- | --- | --- | -| refreshToken | String \| Undefined | Optional if not restored from a securely saved user. | +### user.reauthenticate() ⇒ [Promise.<User>](#User) +Re-authenticates a user with the the expired authentication token using the refresh token. +**Kind**: instance method of [User](#User) ### user.logout() ⇒ Promise.<Boolean> Logout the user by expiring the authentication token and removing any saved data. +**Kind**: instance method of [User](#User) + + +### user.serialize() ⇒ string +Converts a user object to a string to be securely stored. + +Note that serialized object contains refreshToken and it's subject to strict storage requirements +to ensure that they are not leaked + **Kind**: instance method of [User](#User) ### user.save() ⇒ Promise.<Boolean> Save the user to disk. Prevents having to login and logout each run. -Note that this function does not save a refreshToken since it's a subject to strict storage requirements. -Use `serialize` and `deserealize` functions and safe storage to use `reauthenticate` . -**Kind**: instance method of [User](#User) - - -### user.serialize() ⇒ String -Converts a user object to a string to be securely stored. -Note that serialized object contains refreshToken and it's a subject to strict storage requirements to ensure that they are not leaked. **Kind**: instance method of [User](#User) - -### user.isAuthenticated() ⇒ Boolean +### user.isAuthenticated() ⇒ boolean Checks if the current user is authenticated and authentication is not expired. -**Kind**: instance method of [User](#User) +**Kind**: instance method of [User](#User) -### user.getAuthToken() ⇒ String \| Null +### user.getAuthToken() ⇒ null \| string Returns an auth token. -**Kind**: instance method of [User](#User) +**Kind**: instance method of [User](#User) -### user.getAccountNumber() ⇒ String \| Null +### user.getAccountNumber() ⇒ null \| string Returns an account number. -**Kind**: instance method of [User](#User) +**Kind**: instance method of [User](#User) -### user.getUsername() ⇒ String \| Null +### user.getUsername() ⇒ null \| string Returns a username. + **Kind**: instance method of [User](#User) - ### user.getAccount() ⇒ Promise @@ -1459,18 +1457,31 @@ Downloads will be attempted every second and will wait for any connection thrott | --- | --- | | folder | String | + + +### User.deserialize(data) ⇒ [Promise.<User>](#User) +Restores a user from the serialized object. + +**Kind**: static method of [User](#User) + +| Param | Type | Description | +| --- | --- | --- | +| data | String | serialized data | + ### User.load() ⇒ [Promise.<User>](#User) If a saved user exists, this will load it into system memory. Recommended if using multi-factor authentication. + **Kind**: static method of [User](#User) + - +### User.isUser(object) ⇒ boolean +Checks if the provided object an instance of User object -### User.deserialize(data) ⇒ [Promise.<User>](#User) -Restores a user object from a serialized string. **Kind**: static method of [User](#User) - Param | Type | +| Param | Type | | --- | --- | -| data | String | \ No newline at end of file +| object | Object | +