Code Monkey home page Code Monkey logo

technical-indicators's People

Contributors

arkochhar avatar nashok1226 avatar techie-subhadeep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

technical-indicators's Issues

alpha must satisfy: 0 < alpha <= 1

Hi

When i'm trying to run unit test cases getting this error.

EMA Test with alpha False
Time taken by Pandas computations for EMA 0.00962901115417
Time taken by manual computations for EMA 0.0966241359711
Total Rows: 5232
Columns Match: 5
Success Rate: 0.0%
EMA Test with alpha True
Traceback (most recent call last):
File "indicator.py", line 763, in
test_EMA(df, forATR=True)
File "indicator.py", line 388, in test_EMA
EMA(df, colFrom, colTo, test_period, alpha=forATR)
File "indicator.py", line 142, in EMA
df[target] = con.ewm(alpha=1 / period, adjust=False).mean()
File "/Users/anil.bhatt/anaconda/lib/python2.7/site-packages/pandas/core/generic.py", line 6069, in ewm
adjust=adjust, ignore_na=ignore_na, axis=axis)
File "/Users/anil.bhatt/anaconda/lib/python2.7/site-packages/pandas/core/window.py", line 2066, in ewm
return EWM(obj, **kwds)
File "/Users/anil.bhatt/anaconda/lib/python2.7/site-packages/pandas/core/window.py", line 1658, in init
self.com = _get_center_of_mass(com, span, halflife, alpha)
File "/Users/anil.bhatt/anaconda/lib/python2.7/site-packages/pandas/core/window.py", line 1971, in _get_center_of_mass
raise ValueError("alpha must satisfy: 0 < alpha <= 1")
ValueError: alpha must satisfy: 0 < alpha <= 1

Can you please help here

Make supertrend calculation faster

@arkochhar Thank you for writing supertrend calcuator in Python.

Once supertrend is calculated and stored in dataframe, if new data comes, we should be able to append the new data to existing dataframe and supertrend should be calculated to only new data but not for entire data.

RSI needs period flexibility

RSI function :

Args :
    df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns
    base : String indicating the column name from which the MACD needs to be computed from (Default close)
    period : Integer indicates the period of computation in terms of number of candles
    
Returns :
    df : Pandas DataFrame with new columns added for 
        Relative Strength Index (RSI_$period)
"""

delta = df[base].diff()
up, down = delta.copy(), delta.copy()
if len(delta)>(period-1):
    up[up < 0] = 0
    down[down > 0] = 0

    rUp = up.ewm(com=period - 1,  adjust=False).mean()
    rDown = down.ewm(com=period - 1, adjust=False).mean().abs()

    df['RSI_' + str(period)] = 100 - 100 / (1 + rUp / rDown)
    df['RSI_' + str(period)].fillna(0, inplace=True)
else:
    df['RSI_' + str(period)] = pd.Series()
    df['RSI_' + str(period)].fillna(0, inplace=True)

return df

`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.