Errors, bugs, questions - page 155

 

   if(PositionSelect(_Symbol))
     {
      if(HistorySelectByPosition(PositionGetInteger(POSITION_IDENTIFIER)))
        {
         total=HistoryDealsTotal();
         //total=HistoryOrdersTotal();
         Print("total = "+IntegerToString(total));
         for(i=0; i<total; i++)
           {
           
            ticket=HistoryDealGetTicket(i);
            //ticket=HistoryOrderGetTicket(i);
            if(ticket > 0)
              {
               if(1906 == HistoryDealGetInteger(ticket, DEAL_MAGIC))
               //if(1906 == HistoryOrderGetInteger(ticket, ORDER_MAGIC))
                 {
                  nCount++;
                 }
              }
           }
        }
     }
  

   Print( "Количество сделок по символу "+_Symbol+" "+IntegerToString(nCount));

If Expert Advisor is running on a demo or just running the script, it will return the number of trades,

But if Expert Advisor is tested in the tester, it always returns one trade in this code.

The code shows that I tried to pull both orders and deals, but in normal mode everything is returned normally, but in the tester only one deal is returned.

 
AlexSTAL:

It is totally unreasonable to run the 32-bit version of the terminal on a 64-bit operating system, request a lot of memory, and then be surprised by the lack of memory.

Use the 64 bit version of the terminal.

 
Renat:

It is totally unreasonable to run the 32-bit version of the terminal on a 64-bit operating system, request a lot of memory, and then be surprised by the lack of memory.

Use the 64 bit version of the terminal.

Thank you! The problem here is that not everyone I know has 64 bits and so much memory....

The problem in 32 bits was solved trivially - I put a limit on the number of bars in the window in the global settings.

Документация по MQL5: Доступ к таймсериям и индикаторам / Bars
Документация по MQL5: Доступ к таймсериям и индикаторам / Bars
  • www.mql5.com
Доступ к таймсериям и индикаторам / Bars - Документация по MQL5
 
Konstantin83:

If Expert Advisor is running on a demo or just running the script, it will return the number of trades,

But if Expert Advisor is tested in the tester, it always returns one trade in this code.

The code shows that I tried to pull both orders and deals, but in normal mode everything is returned normally, but in the tester only one deal is returned.

Please send us the complete code of the Expert Advisor.
 
Graff:
MT5 does not work through proxies (http,socks 4,5) Build 328. However, MT4 works fine through these proxies.

How do I get MT5 to work through a proxy?

 

Here's a question:

I'm determining the number of decimal places:

int digit=SymbolInfoInteger(symbol, SYMBOL_DIGITS);

I get a warning when compiling:

possible loss of data due to type conversion for variable digit

It is unclear why, since the data type is integer.

If I try to change the data type to long, ulong or any other, a similar warning pops up on another line and also for the variable digit:

SL=NormalizeDouble(SL, digit);

What am I doing wrong?

 
Try it this way:
int digit= (int)SymbolInfoInteger(symbol, SYMBOL_DIGITS);

 
AsAn:

Here's a question:

I'm determining the number of decimal places:

I get a warning when compiling:

possible loss of data due to type conversion for variable digit

It is unclear why, since the type of data to be obtained is integer.

If I try to change the data type to long, ulong or any other, a similar warning pops up on another line and also for the variable digit:

What am I doing wrong?

It is fixed like this

int digit= (int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
 
Thank you. The cure works :))
 

I have a small suggestion.

Why not make reports in mht(web archive), it seems more convenient for users.

1 report - 1 file, not 2 as now (html and png)

Reason: