Looking for Supertrend calculation method in Python

I am looking for information about Supertrend calculation implementation in Python. Some tools have a build in Supertrend indicator that changes color to indicate the trend direction. I came across this implementation of Supertrend calculation: https://github.com/techietrader/Trading-indicators-and-Chart-patterns/blob/master/Indicators/Super_Trend.py

It produces a line that follows a closing value very closely but there is nothing in this code that clearly indicates which values on the calculated line fall into the UP trend and which values fall into the the DOWN trend categories.

In the above implementation, is it correct to assume that the values that are copied into df['Supertrend'] from df['Supertrend_lower_band'] are the down-trend values and the values that are copied into the df['Supertrend'] from df['Supertrend_upper_band'] are the up-trend values ?

Submitted September 28, 2020 at 08:46PM by WellDoneCode
via https://ift.tt/3jdrsYA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s