The moving averages 350 and 111 by themselves do a great job of identifying market tops/bottoms. The fraction 350/111 is very close to Pi as well (3.15) so that's is suspicious in its own right.
Nonetheless, fibonacci retracements/multiplies of the 350 SMA does a remarkable job of finding reversal points. I commented out a couple of multiplies for simplicity's sake (the lines became rather crowded). However, the script is open source so you all can copy it into Pine Editor and delete the "//" and add it back to the script.
Cheers.