Giter Site home page Giter Site logo

easyai / python-charting-indicators Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 14.0 104 KB

This repository contains a python file with is used to calculate charting indicators.

License: MIT License

Python 100.00%
algorithms analytics charts financial-analysis

python-charting-indicators's People

Contributors

easyai avatar

Stargazers

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

python-charting-indicators's Issues

TypeError: cannot perform reduce with flexible type

Hi i'm using get_MACD function and i use this function to get candles
candles = bot.get_klines(symbol="BTCUSDT", interval=bot.KLINE_INTERVAL_1MINUTE)
and this is my candles output:
[[unixtime, open, high, low, close, volume], ...]
and i get this error:
TypeError: cannot perform reduce with flexible type

ADX is wrong

ADX indicator is wrong calculated.
+DI and -DI are OK, but not ADX

I were not able to figure where to correct it.

MACD zero lag is wrong

Hello,
I thing MACD zero lag calculation is not the correct one, I don't have any match with a TradingView MACD 0 lag chart.

I used to made it work with DEMA formula, perfect match with TradingView. This made me work my Python :)

You can used it:

def get_DEMA(prices, maPeriod, prec=8):
	
	EMA1 = get_EMA(prices, maPeriod)
	EMA2 = get_EMA(EMA1, maPeriod)
	DEMA = np.subtract ((2 * EMA1[:len(EMA2)]), EMA2)

	return DEMA.round(prec)
def get_zeroLagMACD(prices, Efast=12, Eslow=26, signal=9):
	
	z1 = get_DEMA (prices, Efast)
	z2 = get_DEMA (prices, Eslow)
	lineMACD = np.subtract (z1[:len(z2)], z2)
	lineSIGNAL = get_DEMA (lineMACD, signal)
	histogram = np.subtract(lineMACD[:len(lineSIGNAL)], lineSIGNAL)

	return [({
		"macd":float("{0}".format(lineMACD[i])), 
		"signal":float("{0}".format(lineSIGNAL[i])), 
		"hist":float("{0}".format(histogram[i]))}) for i in range(len(lineSIGNAL))]

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.