Package QSTK :: Package qstkfeat :: Module features
[hide private]
[frames] | no frames]

Module features

source code

Created on Nov 7, 2011


Author: John Cornwell

Contact: JohnWCornwellV@gmail.com

Functions [hide private]
 
featMA(dData, lLookback=30, bRel=True)
Calculate moving average
source code
 
featRSI(dData, lLookback=14)
Calculate RSI
source code
 
featDrawDown(dData, lLookback=30)
Calculate Drawdown for the stock
source code
 
featRunUp(dData, lLookback=30)
CalculateRunup for the stock
source code
 
featVolumeDelta(dData, lLookback=30)
Calculate moving average
source code
 
featAroon(dData, bDown=False, lLookback=25)
Calculate Aroon - indicator indicating days since a 25-day high/low, weighted between 0 and 100
source code
 
featStochastic(dData, lLookback=14, bFast=True, lMA=3)
Calculate stochastic oscillator - indicates what range of recent low-high spread we are in.
source code
 
featBeta(dData, lLookback=14, sMarket='$SPX')
Calculate beta relative to a given stock/index.
source code
 
featBollinger(dData, lLookback=20)
Calculate bollinger position as a function of std deviations.
source code
 
featCorrelation(dData, lLookback=20, sRel='$SPX')
Calculate correlation of two stocks.
source code
Variables [hide private]
  __package__ = 'QSTK.qstkfeat'
Function Details [hide private]

featMA(dData, lLookback=30, bRel=True)

source code 
Parameters:
  • dData - Dictionary of data to use
  • lLookback - Number of days to look in the past
Returns:
DataFrame array containing values

featRSI(dData, lLookback=14)

source code 
Parameters:
  • dData - Dictionary of data to use
  • lLookback - Number of days to look in the past, 14 is standard
Returns:
DataFrame array containing values

featDrawDown(dData, lLookback=30)

source code 
Parameters:
  • dData - Dictionary of data to use
  • lLookback - Days to look back
Returns:
DataFrame array containing values

Warning: Drawdown and RunUp can depend heavily on sample period

featRunUp(dData, lLookback=30)

source code 
Parameters:
  • dData - Dictionary of data to use
  • lLookback - Number of days to calculate min over
Returns:
DataFrame array containing feature values

Warning: Drawdown and RunUp can depend heavily on when the sample starts

featVolumeDelta(dData, lLookback=30)

source code 
Parameters:
  • dData - Dictionary of data to use
  • lLookback - Number of days to use for MA
Returns:
DataFrame array containing values

featAroon(dData, bDown=False, lLookback=25)

source code 
Parameters:
  • dData - Dictionary of data to use
  • bDown - If false, calculates aroonUp (high), else aroonDown (lows)
  • lLookback - Days to lookback to calculate high/low from
Returns:
DataFrame array containing feature values

featStochastic(dData, lLookback=14, bFast=True, lMA=3)

source code 
Parameters:
  • dData - Dictionary of data to use
  • bFast - If false, do slow stochastics, 3 day MA, if not use fast, no MA
Returns:
DataFrame array containing feature values

featBeta(dData, lLookback=14, sMarket='$SPX')

source code 
Parameters:
  • dData - Dictionary of data to use
  • sStock - Stock to calculate beta relative to
Returns:
DataFrame array containing feature values

featBollinger(dData, lLookback=20)

source code 
Parameters:
  • dData - Dictionary of data to use
  • lLookback - Number of days to calculate moving average over
Returns:
DataFrame array containing feature values

featCorrelation(dData, lLookback=20, sRel='$SPX')

source code 
Parameters:
  • dData - Dictionary of data to use
  • lLookback - Number of days to calculate moving average over
Returns:
DataFrame array containing feature values