카테고리 없음

tulipindicators

나스닥171819 2023. 2. 20. 23:37
728x90
반응형

 

tulipindicators

 

 

https://github.com/TulipCharts/tulipindicators

 

GitHub - TulipCharts/tulipindicators: Technical Analysis Indicator Function Library in C

Technical Analysis Indicator Function Library in C - GitHub - TulipCharts/tulipindicators: Technical Analysis Indicator Function Library in C

github.com

https://github.com/cirla/tulipy

 

GitHub - cirla/tulipy: [NOT ACTIVELY MAINTAINED] Tulipy - Financial Technical Analysis Indicator Library (Python bindings for Tu

[NOT ACTIVELY MAINTAINED] Tulipy - Financial Technical Analysis Indicator Library (Python bindings for Tulip Charts) - GitHub - cirla/tulipy: [NOT ACTIVELY MAINTAINED] Tulipy - Financial Technical ...

github.com

pip install tulipy

 

python3 -m build

 

pip install tulipy-0.4.0-cp310-cp310-win_amd64.whl

 

 

 

 

 

Python - Draw MACD using Tulip Indicators & Matplotlib | OpenWritings.net

 

Python - Draw MACD using Tulip Indicators & Matplotlib | OpenWritings.net

Overview Here is a simple example showing how to use Tulip Indicators and Matplotlib to draw Moving Average Convergence/Divergence (MACD). The data used here is taken from https://tulipindicators.org/macd. Requirement Code #!/usr/bin/python3   import pand

openwritings.net

 

 

#!/usr/bin/python3
 
import pandas as pd
import tulipy as ti
 
import matplotlib
matplotlib.use('Agg') # Bypass the need to install Tkinter GUI framework
import matplotlib.pyplot as plt
 
# Avoid FutureWarning: Pandas will require you to explicitly register matplotlib converters.
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
 
 

loaded_data = pd.read_csv('data.csv')#, sep=',')
 
# Plot the main graph.
##########################
x = loaded_data['Time']
y = loaded_data['Close']
 

 
# Plot MACD.
##########################
short_period  = 12
long_period   = 26
signal_period = 9
 
# Calculate MACD.
macd_input=loaded_data['Close'].values   # Convert pandas dataframe to NumPy array.
(macd, macd_signal, macd_histogram) = ti.macd(macd_input, short_period=short_period,
                                                            long_period=long_period,
                                                            signal_period=signal_period)


#df = pd.DataFrame(macd)
#df.to_csv('file1a1.csv', index=False, header=False)
#df = pd.DataFrame(macd_signal)
#df.to_csv('file1a2.csv', index=False, header=False)
#df = pd.DataFrame(macd_histogram)
#df.to_csv('file1a3.csv', index=False, header=False)



macd_x = loaded_data['Time'].values
macd_x = macd_x[4:]   # Skip 1st 4 due to long_period=5.
 


import numpy as np
 

x = np.arange(0, 2835, 1)
y = 1 + np.sin(x)

plt.plot(x, macd)
plt.plot(x, macd_signal)
plt.plot(x, macd_histogram)

plt.xlabel('x value', fontsize=15)
plt.ylabel('y value', fontsize=15)
plt.title('sin graph', fontsize=18)

plt.grid()

plt.show()
 
# Customize graph
##########################
# Set graph labels & legend
title='Draw MACD({}, {}, {}) on right axis \nusing Tulip Indicator & Matplotlib'.format(
                                                short_period, long_period, signal_period)
plt.title(title)

#plt.gcf().autofmt_xTime()   # Beautify the x-labels
plt.autoscale(tight=True)
 
# Save graph to file.
plt.savefig('macd-right-axis-tulip-matplotlib.png')
 
 
 

 

 

반응형