Errors, bugs, questions - page 866

 
avoitenko:

It only works in the tester and has no effect on real trading, i.e. you will not be able to withdraw money from your account.

But you are not testing it correctly. Why does your trade have a ticket of 3?

The original question was a little different. Ticket 3 - because in the strategy tester, under this ticket there is a withdrawal of funds using the TesterWithdrawal(1.0) function. In the history (in visualization mode) is written that there was charged 1.0, on request by this ticket there is returned 0.0. On the real server, also specifying a ticket on which there was a withdrawal of funds, returns the amount which is specified there.
 

Since I haven't seen your code, it's hard to say. But I sketched out mine. What do you get from it in the tester?

//+------------------------------------------------------------------+
//|                                                   WithDrawal.mq5 |
//|                                                        avoitenko |
//|                        https://www.mql5.com/en/users/avoitenko |
//+------------------------------------------------------------------+
#property copyright "avoitenko"
#property link      "https://www.mql5.com/en/users/avoitenko"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   TesterWithdrawal(1.0);
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(HistorySelect(0,TimeCurrent()))
     {
      int total=HistoryDealsTotal();
      for(int i=0;i<total;i++)
        {
         ulong ticket=HistoryDealGetTicket(i);
         PrintFormat("ticket=%d, profit=%.2f",ticket,HistoryDealGetDouble(ticket,DEAL_PROFIT));
        }
     }
  }
//+------------------------------------------------------------------+
 
avoitenko:

Since I haven't seen your code, it's hard to say. But I sketched out mine. What does it give you in the tester?

Exactly the same line, from the real server, returns the correct amount.

HI 0 test_forum (EURUSD,M12) 18:30:59 2011.01.03 00:00 ticket=1, profit=100000.00
RO 0 test_forum (EURUSD,M12) 18:30:59 2011.01.03 00:00 ticket=2, profit=-1.00
OM 0 test_forum (EURUSD,M12) 18:30:59 2011.01.03 00:00:00 deposit=0.0
//+------------------------------------------------------------------+
//| WithDrawal.mq5 |
//| avoitenko |
//| https://www.mql5.com/en/users/avoitenko |
//+------------------------------------------------------------------+
#property copyright "avoitenko"
#property link "https://www.mql5.com/en/users/avoitenko"
#property version "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
TesterWithdrawal(1.0);
return(0);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
if(HistorySelect(0,TimeCurrent()))
{
int total=HistoryDealsTotal();
for(int i=0;i<total;i++)
{
ulong ticket=HistoryDealGetTicket(i);
PrintFormat("ticket=%d, profit=%.2f",ticket,HistoryDealGetDouble(ticket,DEAL_PROFIT));
}
}
  if(HistoryDealSelect(2))Print("Пополнение=",HistoryDealGetDouble(2,DEAL_PROFIT));  //<--Дописываем это, и что-то уже не то получается
}

//+------------------------------------------------------------------+
 
//<--Describe this, and something is already wrong<br / translate="no">

It is quite possible that HistoryDealSelect does not work as it should in the tester .

With this it's better to contact servicedesk.

But as you can see, TesterWithdrawal has nothing to do with it.


 

Good evening, I have a question aboutFileFindFirst() andFileFindNext().

There are txt files in C:\Program Files\MetaTrader 5\MQL5\Files\hand_strength_flop folder.

void OnStart()
  {
   bool next;
   long handle_find;
   string filename;
   int i=0;

   handle_find=FileFindFirst("hand_strength_flop",filename);
   if(handle_find!=INVALID_HANDLE)
    {
     Print("filename:  ",filename);

     while(true)
      {
       next=FileFindNext(handle_find,filename);
       if(next==false) { Print(i,"  next false  ",_LastError); break; }
       
       i++;
       Print(i+"  filename:  ",filename);
      }
     FileFindClose(handle_find);
    }
   else Print("INVALID_HANDLE  "+_LastError);
   
  }

The script somehow outputs only

2012.11.03 18:07:18 446 (GBPUSD,H2) 0 next false 0

2012.11.03 18:07:18 446 (GBPUSD,H2) filename: hand_strength_flop\

I am expecting to see the names of files that are in the directory I have specified. But it is not shown. ?????????

 
Stasikusssss:

hand_strength_flop\

I'm expecting to see the names of the files that are in the specified directory. But they don't show up. ?????????

FileFindFirst thinks"hand_strength_flop" is a file

"hand_strength_flop\*.txt" or

"\hand_strength_flop\*.txt"

"hand_strength_flop\*.txt"

"\\hand_strength_flop\\*.txt"

 

A100, thank you!!! thank you!!!

it works now.

 
After updating either the website or the terminal for Androil - the Metacvots ID has been erased. is this the case for everyone?
 
Vladon:
After updating either the website or the terminal for Androil - the Metacvots ID has been erased. is this the case for everyone?
Where exactly did it get erased? In the website profile or in the mobile terminal?
 

Renat:
Где именно стерся? В профиле сайта или в мобильном терминале?

I was in the site profile, it was full and I did not touch it, then today I was doing work - and the tablet is silent,

I thought what's up - then I went to the site and my ID wasn't there.

Filled out a new one, I can not say it has changed or not, in my opinion the numbers are the same.

Reason: