Hi Philby,
Selling to gain a loss and buying back is not allowed by the tax office. They call this a wash down. I believe if a different legal entity was to buy then this is ok. eg. you sell and your wife buys. or a family trust buys. so on, so on. Gotta hate the tax office.