Calculation for finding uptrend or downtrend as per Dow theory

I am unable to find the correct calculation for finding trends as per dow theory. Can somebody please guide as to how to find it in python . Any guidance or help is much appreciated.

regards:
Akhilesh

Team,
please send zigzag indicator code

Hi @akhilesh ,

Refer the below link-