How to setup Algo-Trading for Simple Breakout Trading Strategy?
Condition: It is very simple. If price breaks out above the previous day’s high, go long. If price breaks out below the previous day’s low, short. There is one additional check – price should have opened between previous day’s low and high
Script Setup:
I’ll go long if
• Today’s opening price is less than previous day’s high
• Today’s high is greater than previous day’s high (this is break out to upside)
• Current time is between 9.45 & 3.15
I’ll short if
• Today’s opening price is higher than previous day’s low
• Today’s low is lower than previous day’s low (this is break out to downside)
• Current time is between 9.45 & 3.15
This simple set-up can be used to create AFLs for any of the breakout patterns in including Flag, Triangles, etc. We will use this code as base template in future episodes to teach various breakout patterns.