diff --git a/MtApi5/MtApi5Client.cs b/MtApi5/MtApi5Client.cs index b75bd2a0..e0d2d54a 100755 --- a/MtApi5/MtApi5Client.cs +++ b/MtApi5/MtApi5Client.cs @@ -2286,6 +2286,30 @@ public void TesterStop() SendCommand(ExecutorHandle, Mt5CommandType.TesterStop); } + /// + ///Deposits money to the account of the tested Expert Advisor. + ///Works only in the strategy tester (see IsTesting); fails with an error when the Expert Advisor runs on a live chart. + /// + ///Deposited sum of money. + ///true if successful, otherwise false. + public bool TesterDeposit(double money) + { + Dictionary cmdParams = new() { { "Money", money } }; + return SendCommand(ExecutorHandle, Mt5CommandType.TesterDeposit, cmdParams); + } + + /// + ///Withdraws money from the account of the tested Expert Advisor. + ///Works only in the strategy tester (see IsTesting); fails with an error when the Expert Advisor runs on a live chart. + /// + ///Withdrawn sum of money. + ///true if successful, otherwise false. + public bool TesterWithdrawal(double money) + { + Dictionary cmdParams = new() { { "Money", money } }; + return SendCommand(ExecutorHandle, Mt5CommandType.TesterWithdrawal, cmdParams); + } + #endregion // Common Functions #region Object Functions diff --git a/MtApi5/MtProtocol/Mt5CommandType.cs b/MtApi5/MtProtocol/Mt5CommandType.cs index 4af91bdb..51228432 100755 --- a/MtApi5/MtProtocol/Mt5CommandType.cs +++ b/MtApi5/MtProtocol/Mt5CommandType.cs @@ -260,6 +260,9 @@ internal enum Mt5CommandType OrderCheck = 303, Buy = 304, Sell = 305, - GetSymbols = 306 + GetSymbols = 306, + + TesterDeposit = 370, + TesterWithdrawal = 371 } } diff --git a/TestClients/MtApi5TestClient/MainWindow.xaml b/TestClients/MtApi5TestClient/MainWindow.xaml index c30fe43e..9bed0584 100755 --- a/TestClients/MtApi5TestClient/MainWindow.xaml +++ b/TestClients/MtApi5TestClient/MainWindow.xaml @@ -614,6 +614,8 @@