func CloseAllPositions(c *check.C, client *oanda.Client) { positions, err := client.Positions() c.Assert(err, check.IsNil) for _, pos := range positions { _, err = client.ClosePosition(pos.Instrument) c.Assert(err, check.IsNil) } }