Simulate deposit withdrawal

 
Hi. I want to somehow simulate deposit withdrawal in MQL4. I want after a trade is closed to take any surplus above the initial deposit from balance. Ideally save this number somewhere. Any ideas?
 
Hi
i am take it withdrawal amount but our broker company not transfer my amount not to withdrawal my amount...please support me
 
Georgios Kourogiorgas:
Hi. I want to somehow simulate deposit withdrawal in MQL4. I want after a trade is closed to take any surplus above the initial deposit from balance. Ideally save this number somewhere. Any ideas?

Hello , do you mean in the testing process ? or as part of an ea that "locks" an amount available for withdrawal.

(Locking would entail not using it as margin , showing the user its available ,But , it would be vulnerable until it were withdrawn.That is your issue in the tester , even if its not used it acts as a "cushion" when drawdown rises)

 
Lorentzos Roussos:

Hello , do you mean in the testing process ? or as part of an ea that "locks" an amount available for withdrawal.

(Locking would entail not using it as margin , showing the user its available ,But , it would be vulnerable until it were withdrawn.That is your issue in the tester , even if its not used it acts as a "cushion" when drawdown rises)

Hello, At first I would like to simulate in testing. Any ideas for MQL4?

 
Georgios Kourogiorgas:

Hello, At first I would like to simulate in testing. Any ideas for MQL4?

Theres actually TesterWithdrawal() , TesterDeposit() , chance to put them to the test [was unaware of their existence]

https://www.mql5.com/en/docs/common/testerwithdrawal

https://www.mql5.com/en/docs/common/testerdeposit

 
Lorentzos Roussos:

Theres actually TesterWithdrawal() , TesterDeposit() , chance to put them to the test [was unaware of their existence]

https://www.mql5.com/en/docs/common/testerwithdrawal

https://www.mql5.com/en/docs/common/testerdeposit

I have run into these. Wasn't sure these would work in MQL4. Thanks. Will report back

 
How'd you end up going with this? I've recently been trying to figure out the same thing for testing on my own EA but it seems the TesterWithdrawal function doesn't work for MT4, only MT5. I had considered learning MQL5 so that I could try converting my EA but they've made MQL5 so much more convoluted in the differences/additional lines of code required to achieve the same basic things -- that I could just really not be bothered right now. Probably still more simple to figure out another way to emulate withdrawals within MQL4.
Reason: