The first part of trade automation that I am going to discuss is trade identification. As this involves both identification and a quick risk/reward analysis, before we get too far, I wanted to introduce a quick and dirty way to get a feel for targets and stops.
One very quick way to do this is to have pre-determined trading levels. For example, intra-day, we can use daily and weekly pivots. On longer-term timeframes, we can identify support and resistance levels on charts.
Using python, I quickly whipped up some support/resistance level using the most basic of algorithms. I defined support or resistance as that point where d(Price)/dt = 0, using close-only values to keep things simple. Other additions such as volume weighting, price binning, and intra-day movement can be added quickly to give better levels.