In view of such flaws as low accuracy, slow convergence rate and oscillation in the later stage which are commonly found in the traditional artificial fish swarm algorithm, a proposal has thus been made of an artificial fish swarm algorithm with adaptive visual field and step length. Taking the distance between the two artificial fish as the visual field, the proposed algorithm multiplies the obtained results by a coefficient as the step length. With the continuous accumulation of fish, the corresponding reduction in visual field and step length is conducive to locating the optimum point. The experimental results show that the improved algorithm is characterized with advantages of better convergence rate and higher accuracy.