As a stochastic optimiser, the firefly algorithm (FA) has been successfully and widely used in the solutions to various optimisation problems. Recent related research shows that the standard FA does not sufficiently balance between exploration and exploitation. Especially in high-dimensional problems, it is easy for the standard FA to fall into the local optimum and lead to premature convergence. To overcome the problems as mentioned above, DMTgFA uses three strategies: dynamic step length setting strategy (DS), non-elite two-way guidance model (TG) and elites dimensional mutation strategy (DM). The dynamic step length setting strategy makes the algorithm convergence speed faster. The non-elite two-way guidance model and the elite dimensional mutation strategy cooperate to solve the balance problem between global search and local search. Experimental results show that DMTgFA has stronger optimisation ability and faster convergence speed than other state-of-the-art FA variants.