robot's result in the test are difrent from the real account

 
I made a robot, and I have a problem,
The robot's result in the test are difrent from the real account
Both have been tested in ecn account, but the real account result is in loss, and test is in profit
spread and commission in test are more than real account
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
, then each symbol positions will be closed in the same order, in which they are opened, starting with the oldest one. In case of an attempt to close positions in a different order, the trader will receive an appropriate error. There are several types of accounts that can be opened on a trade server. The type of account on which an MQL5 program...