Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/edyatl/impulse-macd

Python porting of Impulse MACD [LazyBear] TradingView Indicator
https://github.com/edyatl/impulse-macd

Last synced: 3 days ago
JSON representation

Python porting of Impulse MACD [LazyBear] TradingView Indicator

Awesome Lists containing this project

README

        

## Python porting of Impulse MACD [LazyBear]

>Developed by [@edyatl](https://github.com/edyatl) March 2023

### Using [Python wrapper](https://github.com/TA-Lib/ta-lib-python) for [TA-LIB](http://ta-lib.org/) based on Cython instead of SWIG.

### Original Indicator code

```python
//
// @author LazyBear
//
// List of my public indicators: http://bit.ly/1LQaPK8
// List of my app-store indicators: http://blog.tradingview.com/?p=970
//
//
study("Impulse MACD [LazyBear]", shorttitle="IMACD_LB", overlay=false)
lengthMA = input(34)
lengthSignal = input(9)
calc_smma(src, len) =>
smma=na(smma[1]) ? sma(src, len) : (smma[1] * (len - 1) + src) / len
smma

calc_zlema(src, length) =>
ema1=ema(src, length)
ema2=ema(ema1, length)
d=ema1-ema2
ema1+d

src=hlc3
hi=calc_smma(high, lengthMA)
lo=calc_smma(low, lengthMA)
mi=calc_zlema(src, lengthMA)

md=(mi>hi)? (mi-hi) : (mimi?src>hi?lime:green:src