Errors, bugs, questions - page 110

 

Afternoon.

When compiling the MACD Sample.mq5 Expert Advisor from the Examples folder, it generates the following error

POSITION_TYPE_BUY' - can't convert enum MACD Sample.mq5 319 50

и

'POSITION_TYPE_SELL' - can't convert enum MACD Sample.mq5 352 50

Terminal has been updated. Please advise what is the matter?

Thank you.

 
Valmars:
For error codes there is ErrorDescription.mqh

Just what I need, thank you.

I wonder why it doesn't come with mt right away... because there's nothing but balls flying around in orbits and other useless examples...

 
Alex5757000:

Afternoon.

When compiling the MACD Sample.mq5 Expert Advisor from the Examples folder, it generates the following error

POSITION_TYPE_BUY' - can't convert enum MACD Sample.mq5 319 50

и

'POSITION_TYPE_SELL' - can't convert enum MACD Sample.mq5 352 50

Terminal has been updated. Please advise what is the matter?

Thank you.

The developers have corrected the standard library, some functions have changed, while the MACD Sample code remains the same. Here is the corrected version of MACD Sample.
 

warrants and transactions


received in the tester... The expert opens a pending order... and then he opens the next one... and he can open it even without any money... and then he deletes it a second later? add at least a second to the deal display or make a visualization...

 

316 build is out but OrderCalcMargin still returns zero for #AA tools

PH      0       OrderCalcMargin (EURUSD,H8)     18:00:47        ************************************************
KQ      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Инструмент - #AA
MG      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Валюта депозита = USD
OO      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Базовая валюта = USD
NG      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Валюта маржи = USD
RS      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Депозит = 5930.1
GF      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Свободная маржа = 5930.1
KR      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Цана ask = 10.34
FK      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Цана bid = 10.31
NL      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Маржа для покупки 1 лота = 0
HE      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Маржа для продажи 1 лота = 0
RL      0       OrderCalcMargin (EURUSD,H8)     18:00:47        ************************************************
HQ      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Инструмент - #AIG
MK      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Валюта депозита = USD
OS      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Базовая валюта = USD
NK      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Валюта маржи = USD
RO      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Депозит = 5930.1
GJ      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Свободная маржа = 5930.1
ON      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Цана ask = 35.15
HG      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Цана bid = 35.12
NP      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Маржа для покупки 1 лота = 0
HI      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Маржа для продажи 1 лота = 0
RP      0       OrderCalcMargin (EURUSD,H8)     18:00:47        ************************************************
FE      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Инструмент - #AXP
MO      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Валюта депозита = USD
OG      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Базовая валюта = USD
NO      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Валюта маржи = USD
RK      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Депозит = 5930.1
GN      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Свободная маржа = 5930.1
EJ      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Цана ask = 40.91
GS      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Цана bid = 40.88
ND      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Маржа для покупки 1 лота = 0
HM      0       OrderCalcMargin (EURUSD,H8)     18:00:47        Маржа для продажи 1 лота = 0
RD      0       OrderCalcMargin (EURUSD,H8)     18:00:47        ************************************************
how soon will this problem be resolved
 

I'm figuring it out... I'm trying to write as much code as possible... Is there no easier way to get the first of the current month?

Alert(" первоечисло=",ПервоеЧислоМесяца());


datetime ПервоеЧислоМесяца()
   {
   MqlDateTime Первоечисло;
   TimeCurrent(Первоечисло);
   Первоечисло.day=1;
   Первоечисло.hour=0;
   Первоечисло.min=0;
   Первоечисло.sec=0;
   return(StructToTime(Первоечисло));
   }
 
Dmitriy2:

I'm figuring it out... I'm trying to write as much code as possible... Is there no easier way to get the first day of the current month?

It depends on what you want to get the first day of the month, you can try this

MqlDateTime str;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

  }
//+------------------------------------------------------------------+
datetime ПервоеЧислоМесяца()
  {
   TimeToStruct(TimeCurrent(),str);
   return(StringToTime((string)str.year+"."+(string)str.mon+"."+"01"+" "+"00:00"));
  }
//+------------------------------------------------------------------+
 

Once again I appeal to inquiring minds!

The code is attached.

long A = AccountInfoInteger(ACCOUNT_LOGIN);  // 661701
long B = A;
long C = 661701;

Print(" A=",A,"  B=",B,"  C=",C);

long X =10000;
long Y =10000000000;
long Z =1000000;

long L1 = A*X;
long L2 = B*X;
long L3 = C*X;

long M1 = A*Y/Z;

Print(" L1=",L1,"   L2=",L2,"   L3=",L3,"   M1=",M1);

If I understand programming, it should be L1 = L2 = L3 = M1, but I don't! Don't you?

Mine is like this

2010.08.28 21:37:35     Servis (EURUSD,H1)       L1=2322042704   L2=2322042704   L3=6617010000   M1=4294965997
2010.08.28 21:37:35     Servis (EURUSD,H1)       A=661701  B=661701  C=661701
2010.08.28 21:37:35     Servis (EURUSD,H1)      --- OnInit() --- 1 --- !!!  Старт  подготовки начальных параметров  !!!
Files:
servis.mq5  2 kb
 

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 --- !

 
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 --- !

Thank you. I'll contact the developers then.

Reason: