Created
September 29, 2020 07:27
-
-
Save yuyasugano/9609b6f9cd08fa1698d710b4bafb633f to your computer and use it in GitHub Desktop.
A trend line sample in matplotlib Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slope, intercept, r_value, p_value, std_err = linregress(x=df_high['Number'], y=df_high['Close']) | |
df['Uptrend'] = slope * df['Number'] + intercept | |
slope, intercept, r_value, p_value, std_err = linregress(x=df_low['Number'], y=df_low['Close']) | |
df['Downtrend'] = slope * df['Number'] + intercept | |
df.tail() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment