Errors, bugs, questions - page 111

 
sergeev:

everything matched.

2010.08.28 20:57:09 Servis (EURUSD,H1) L1=6653490000 L2=6653490000 L3=6653490000 M1=6653490000
2010.08.28 20:57:09 Servis (EURUSD,H1) A=665349 B=665349 C=665349
2010.08.28 20:57:09 Servis (EURUSD,H1) --- OnInit() --- 1 --- !


and my M1 didn't match.

PQ      0       Servis (EURUSD,H8)      22:06:24        --- OnInit() --- 1 --- !!!  Старт  подготовки начальных параметров  !!!
LE      0       Servis (EURUSD,H8)      22:06:24         A=100652  B=100652  C=100652
CP      0       Servis (EURUSD,H8)      22:06:24         L1=1006520000   L2=1006520000   L3=1006520000   M1=4294966006
 
sergey1294:

Depending on what you need the first number for, you could try this

Yeah, it's easier that way, you don't even have to put extra inverted commas at the end.
return(StringToTime((string)str.year+"."+(string)str.mon+".01 00:00"));
 
SHOOTER777:

Once again I appeal to inquiring minds!

The code is attached.

If I understand programming, it should be L1 = L2 = L3 = M1. And what about you?

At first the compiler complained about absence of "#import "lbS7N_Servis.ex5".

After deleting this line it gave out:

2010.08.28 22:19:51 Servis[1] (EURUSD,H1) L1=1016990000 L2=1016990000 L3=6617010000 M1=1016990000
2010.08.28 22:19:51 Servis[1] (EURUSD,H1) A=101699 B=101699 C=661701
2010.08.28 22:19:51 Servis[1] (EURUSD,H1) --- OnInit() --- 1 --- !

When I replaced the account number in the code with my own, I got:

2010.08.28 22:26:46 Servis[1] (EURUSD,H1) L1=1016990000 L2=1016990000 L3=1016990000 M1=1016990000

2010.08.28 22:26:46 Servis[1] (EURUSD,H1) A=101699 B=101699 C=101699

2010.08.28 22:26:46 Servis[1] (EURUSD,H1) --- OnInit() --- 1 --- !

MQ server, build 316.

 
sergey1294:

and my M1 didn't match

unique situation... :(
 
Why does SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_LIMIT), return zero?
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Информация об инструменте - Документация по MQL5
 
sergeev:
A unique situation... :(

And there are as many as three unique situations. These are the detected ones. And how many undetected?

And with this state of affairs MetaQuotes is starting the Championship 2010 in a month?

Oh, MetaTrader 5 is full of surprises...

 
Kos:
Why SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_LIMIT), returns zero?

And in addition, the version that returns a success indication (designated as 2. in the help . Returns true or false depending on the success of the function. If successful, the value of the property is placed in the destination variable, passed by reference by the last parameter.) Reports the success of the call:

void OnStart()
{
  double SymbolVolumeLimit1 = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_LIMIT);
  double SymbolVolumeLimit2 = DBL_MAX;

  Print("Symbol() = ", Symbol(), ", bool SymbolInfoDouble() = ", SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_LIMIT, SymbolVolumeLimit2));
  Print("SymbolVolumeLimit1 = ", SymbolVolumeLimit1, ", SymbolVolumeLimit2 = ", SymbolVolumeLimit2);
}

/* Вывод в лог (хронология - сверху вниз):
JN      0       1 (EURUSD,M15)  02:41:18        Symbol() = EURUSD, bool SymbolInfoDouble() = true
JJ      0       1 (EURUSD,M15)  02:41:18        SymbolVolumeLimit1 = 0, SymbolVolumeLimit2 = 0
*/

The second version of SymbolInfoDouble() returned true, i.e. executed successfully. You can also see it in the SymbolVolumeLimit2 variable which was initially initialized with DBL_MAX but received 0 after calling SymbolInfoDouble().

And how, in MetaQuotes' opinion, in such conditions, should Expert Advisors be based on the values returned by such functions, instead of using hardcoded values?

 

Who has used the OrderCheck function.

This is a construct:

           MqlTradeRequest request;
           request.action=TRADE_ACTION_DEAL;
           request.symbol=_Symbol;
           request.volume=volume_exe;
           request.price=SymbolInfoDouble(_Symbol, SYMBOL_ASK);
           request.sl=0;
           request.tp=0;
           request.deviation=SymbolInfoInteger(_Symbol, SYMBOL_SPREAD)*2;
           request.type=ORDER_TYPE_BUY;
           request.type_filling=ORDER_FILLING_CANCEL;
           MqlTradeResult result;
           OrderCheck(request, result);
           if(OrderSend(request, result)==false)

When compiling, I get an error: 'result' - parameter conversion is not allowed.

If you remove OrderCheck, everything compiles normally and position opens in the tester.

 

Here's what it is...

Alert(" прибыль=",ПросчетПрибылизаПериод(D'2010.08.01 00:00:00'));


double ПросчетПрибылизаПериод(datetime датаначалапросчетаприбыли)
  {
   int i;
   double прибыльзапериод;
   ulong тикет;
   HistorySelect(датаначалапросчетаприбыли,TimeCurrent());
   //HistorySelect(D'2010.08.20 00:00:00',D'2010.08.20 23:59:00');
   for(i=1;i<=HistoryDealsTotal();i=i+1)
     {
      тикет=HistoryDealGetTicket(i);
      if(HistoryDealGetInteger(тикет,DEAL_TYPE)==DEAL_ENTRY_IN || HistoryDealGetInteger(тикет,DEAL_TYPE)==DEAL_ENTRY_STATE)
         continue;
      прибыльзапериод=прибыльзапериод+HistoryDealGetDouble(тикет,DEAL_PROFIT)+HistoryDealGetDouble(тикет,DEAL_COMMISSION)+HistoryDealGetDouble(тикет,DEAL_SWAP);
     }
   return(прибыльзапериод);
  }

It should count the profits of the trades from the date specified. It gives a completely different result than it actually is. For example I got 611 instead of result about 2000. I've started checking per day (commented line). There are(!!) days when the result is the same, but usually it is not what it should be...(I couldn't find any regularity). And the debugger produces the same exact cycle for the whole amount of trades. Although I can only trace just this number of deals because no values are displayed for any other variables except for int variables (Expression could not be evaluated).

Is this code correct, and am I using the debugger correctly...?

 
SHOOTER777:

Thank you. I will contact the developers then.

Hello! Describe your situation in detail in the service desk, where you specify the build number, OS, bit rate and attach the code.
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Состояние клиентского терминала
Документация по MQL5: Стандартные константы, перечисления и структуры / Состояние окружения / Состояние клиентского терминала
  • www.mql5.com
Стандартные константы, перечисления и структуры / Состояние окружения / Состояние клиентского терминала - Документация по MQL5
Reason: