In terms of technology, I would suggest R.
In terms of specific actions, you need to decide what to do when the trigger event occurs and you need to decide how to close the positions. Given that, you can then determine your profit and loss on the strategy over the data period.
You can use the random portfolio idea by running your strategy a number of times except use 5 randomly selected stocks in place of your specific 5 stocks. You will then get a distribution of profit and loss from the random stocks to compare against the result from your real strategy. If your strategy is not in the upper tail, then don't do your strategy.
But even if your strategy does look good in that test, that doesn't mean it is a real phenomenon. You got your idea from looking at market data. You don't want the test to be based on data that gave you the idea.
And of course even if your strategy passes a truly out-of-sample test, markets can (and do) change.