Aims. With the purpose of determining the orbital parameters of exoplanetary systems from observational data, we have developed a software, named TRADES (TRAnsits and Dynamics of Exoplanetary Systems), to simultaneously fit observed radial velocities and transit times data. Methods. We implemented a dynamical simulator for N-body systems, which also fits the available data during the orbital integration and determines the best combination of the orbital parameters using grid search, χ 2 minimization, genetic algorithms, particle swarm optimization, and bootstrap analysis. Results. To validate TRADES, we tested the code on a synthetic three-body system and on two real systems discovered by the Kepler mission: Kepler-9 and Kepler-11. These systems are good benchmarks to test multiple exoplanet systems showing transit time variations (TTVs) due to the gravitational interaction among planets. We have found that orbital parameters of Kepler-11 planets agree well with the values proposed in the discovery paper and with a a recent work from the same authors. We analyzed the first three quarters of Kepler-9 system and found parameters in partial agreement with discovery paper. Analyzing transit times (T 0 s), covering 12 quarters of Kepler data, that we have found a new best-fit solution. This solution outputs masses that are about 55% of the values proposed in the discovery paper; this leads to a reduced semi-amplitude of the radial velocities of about 12.80 ms −1 .