mt4 meta editor : showing error TesterWithdrawal() - ambiguous call to overload function

 

any body please help

i want to deduct commission for ecn acc by  TesterWithdrawal() method in strategytester

i just follow the code 


bool TesterWithdrawal(double money ); 

double com;

void OnTick(){

int total = OrdersTotal();
for (ig=total-1; ig >=0; ig--)
{
if (OrderSelect(ig,SELECT_BY_POS,MODE_TRADES))continue;
if ((OrderType()==OP_BUY  || OrderType()==OP_SELL ) && OrderMagicNumber()== magic1 && OrderSymbol()==Symbol())
{
 com =  OrderLots() * 7; //  same as OrderCommission() in my broker
} 
} 


if (order open criteria condition met){
OrderSend(Symbol(),OP_BUY,0.01,Ask,0,0,0,comment,magic1,0,clrBlue);
      TesterWithdrawal(com);
      }

}



but it showing error during compile in metaeditor 5 build 1966 20 dec 2018 : TesterWithdrawal() showing error ambiguous call to overload function



 
Sanibel:

any body please help

i want to deduct commission for ecn acc by  TesterWithdrawal() method in strategytester

i just follow the code 

but it showing error during compile in metaeditor 5 build 1966 20 dec 2018 : TesterWithdrawal() showing error ambiguous call to overload function

Your title says MT4, but your post says MT5?

If it's MT5, you don't need the first line of code...

 
Seng Joo Thio:

Your title says MT4, but your post says MT5?

If it's MT5, you don't need the first line of code...

i m using MT4, showing error on metaeditor during compile mq4

 
Sanibel:

i m using MT4, showing error on metaeditor during compile mq4

TesterWithdrawal() function does not work in Mql4 (can compile, but when run will give error 4014 - ERR_UNKNOWN_COMMAND).

I can see why you have your first line, but unless you're prepared to implement your own version of this function, it's useless having that line there.

 
Seng Joo Thio:

TesterWithdrawal() function does not work in Mql4 (can compile, but when run will give error 4014 - ERR_UNKNOWN_COMMAND).

I can see why you have your first line, but unless you're prepared to implement your own version of this function, it's useless having that line there.

now its compile but no eeror message also in tester


nothing happened also, any others idea to deduct commission/balance from tester?


#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

int OnInit()
  {

   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   
  }

void OnTick()
  {
TesterWithdrawal(10.00);
   
  }

 
Sanibel:

now its compile but no eeror message also in tester

nothing happened also, any others idea to deduct commission/balance from tester?

You'll see error when u include GetLastError() in your code, after you call TesterWithdrawal().

What I know is that MT4 does not support that. Solutions some people tried are (1) using a 3rd party solution (e.g. Tick Data Suite), or (2) do your own code-based moderation of account balance (accounting for commissions) to influence the subsequent lot sizes your EA trades.

Reason: