Stock indicator/trend detector project

Hi, Im very new to the code world. I would appreciate anyones insight regarding this project. I’m trying to build my own stock trend detector. Would anyone of you be able to get me going to where I need to start? these are some codes i stumbled upon.

This is also a project done in 2007. But not sure how reliable this person codes are.

Thanks in advance.