It's a fact, if you look far enough in the past you will see a stock symbol trade in a similar way around certain dominant price levels. This concept of retracing is something I have learned to count on. It's also a very straight forward task to program a computer to look for. In algorithmic trading this strategy of finding price targets and stop loss levels has been very reliable. Using Fibonacci Retracements is a successful way to skim profits at pre-determined percentage levels to get in and get out of a trade in hours or days.
Below is information about how to programmatically find price levels to enter into a trade where there has been many previously successful trades. The strategy here, is that your expecting a scenario that has happen dozens of times in the past with success, to repeat in the future the same way.
One way to have a computer determine support and resistance levels are pivots. In this example you can see that a 55 period pivot high / low makes it obvious where general support and resistance price levels are. The green line represents the pivot high and the purple the pivot low.
For the algorithm to make sense of how the stock symbol trades we are going to collect up all the pivots and tag them as a support level or a resistance levels. By doing this we will be able to later filter them to discover dominant levels. These levels are most often around easily broken down US dollar levels like $34.00 or $34.25. With the price action removed the dominant levels are easier to see.
Once all the levels are input into a database the software will calculate dominant levels by how many times price has bounced off of a pivot point. Because it usually is not exact we will define a pivot as needing to bounce within 1/2% of a level. For example lets say we have a pivot at $34 and we have another 171 pivots between $34.17 and $33.83. The system will designate $34 a significant level
When an indicator alert is triggered the system will first talk to the support and resistance database. This step makes sure that many times historically it has been used for support and the subsequent pivot to the high side was greater than a 1% price movement. If these 2 conditions are met, the alert will be validated and sent out with a percentage rating of how many times a greater than 1% movement has happened.
When the system discovers a valid trade idea a retracement will programmatically overlay the previous pivot This will all happen automatically to generate a series of goal levels and potential stop loss levels. We next determine the price at which the alert was actually sent.
This trade alert was sent out at $36.49. The .382 retracement level was greater than 1% (1.8765 %) so that the level will be set as the target. The stop level is the previous retracement level at $36.19 (-1.2535 %) is not greater than 2% so for this trade we will go down another level to $34.75 or (-4.4449 %)
This trade alert was sent out at $36.41. The .5 retracement level was less than 1% (.8478 %) so we will move up to the next level of $37.39 (2.655 %) this level will be set as the target. The stop level is the previous retracement level at $36.05 (.9936 %) is not greater than 2% so for this trade we will go down another level to $35.23 or (-2.2942 %)