You should draw a flow chart, as well as a permutation table, so that you can have all the situation covered.
What is a permutation table? I couldn't find much useful info with Google, and thefreedictonairy.com says
In computers, a table designed for the systematic construction of code groups; it may also be used to correct garbles in groups of code text.
Which doesn't make it clearer for me.
Since a flow chart is such a handy tool, a 'permutation table' might also be helpful.
here's an example...
you populate the table with your variables,
then go through your chart bar by bar,
and fill the table with all the possible scenarios (ie all the OHLC possibilities),
to determine the permutations with your logic tree.
One of the common stumbling block in programming is, people try to do something that is mutually exclusive. A table with all the variables can help you to sort out the permutations in your logic.