Errors, bugs, questions - page 720

 

Hi all!

I have encountered this bug (or maybe I am misunderstanding something)

When looking at the history for a month, adequate data is displayed, i.e. earned 740, swap -250

At the same time, when I view the entire period, 500 earned points and swap is almost the same

That's why I don't understand how it can be so when the earnings for the entire period are less than the monthly total.

If you need, I can attach history reports

 
tol64:

That is why if you place a 5th pending Buy Stop order with an open position of 3 lots and 4 existing Buy Stop orders of 3 lots each (with a limit of 15 lots), you should not succeed.

Generally, yes - in terms of what's described in the helpe.

But logically - not necessarily. In exchange markets, there are only limit orders in the stack, while stop orders are stored on the broker's server and have two parameters - the activation price ("Price" in MT) and the price of the limit order being placed (the worst price at which the trade is willing to execute). This is similar to the BuyStopLimit and SellStopLimit in MT5, only the Limit can be equal to the stop price or higher (for BuyStopLimit) or lower (for SellStopLimit). In the stock markets, setting a Limit higher (for buying) results in a trade, while this cannot be done in MT. Thus, on exchange markets, especially undeveloped (for example, the Ukrainian Exchange), quite often (and especially on the day of expiration of a quarterly index futures between 16:30-16:35) stops have no time to work and the cup is filled with Limit orders, which under normal conditions, would immediately lead to execution.

So - Limit in market - firm commitment to buy / sell (if money suddenly become scarce, the broker can remove the order, but earlier than it will come to execution), while STOP - simply a record on the server broker, so at the moment of reaching activation price the broker can estimate free funds and decide - expose limit or not. That's why I'm saying that for limits you have to meet the limits, but for stops, in theory, you don't have to.

 
Yedelkin:

Got to DoubleToString? :)

Ah, look at NormalizeDouble:

You have to keep in mind that a normalised number when output to the Journal using Print() may contain more decimal places than you would expect.

   double pi=M_PI;
   Print("pi=",DoubleToString(pi,16));
      
   double pi_3=NormalizeDouble(M_PI,3);
   Print("NormalizeDouble(pi,3) = ",DoubleToString(pi_3,16))
   ;
   double pi_8=NormalizeDouble(M_PI,8);
   Print("NormalizeDouble(pi,8) = ",DoubleToString(pi_8,16));
   
   double pi_0=NormalizeDouble(M_PI,0);
   Print("NormalizeDouble(pi,0) = ",DoubleToString(pi_0,16));
/*
   Результат:
   pi= 3.1415926535897931
   NormalizeDouble(pi,3)= 3.1419999999999999                          <-----------
   NormalizeDouble(pi,8)= 3.1415926499999998                          <-----------
   NormalizeDouble(pi,0)= 3.0000000000000000
*/

Nothing confusing?

 
victorg:

Ah, look at NormalizeDouble:

Anything confusing?

Nope, nothing confusing. In your example

void OnStart()
  {
  double a=2000000.0/3.0;
  Print(DoubleToString(a,30));
  }
there was no reference at all to using the NormalizeDouble() function and normalized numbers. Correspondingly, my remark"Have you got to DoubleToString?:)" was accompanied by a quote from functionDoubleToString() without a shadow of embarrassment.And no one refuted relevance of this quote yet.
 
Yedelkin:

Nope, nothing is confusing. In your example.

There was never any reference to using the NormalizeDouble() function and normalized numbers. Correspondingly, my remark"Have you got to DoubleToString?:)" was accompanied by a quote from functionDoubleToString() without a shadow of embarrassment.And no one refuted relevance of this quote yet.

Actually, I'm not referring to your comment, but to the dock on NormalizeDouble().

 
notused:

Generally, yes - in terms of what's described in the helpe.

But logically - not necessarily. In exchange markets, there are only limit orders in the stack, while stop orders are stored on the broker's server and have two parameters - the activation price ("Price" in MT) and the price of the limit order being placed (the worst price at which the trade is willing to execute). This is similar to the BuyStopLimit and SellStopLimit in MT5, only the Limit can be equal to the stop price or higher (for BuyStopLimit) or lower (for SellStopLimit). In the stock markets, setting a Limit higher (for buying) results in a trade, while this cannot be done in MT. Thus, in exchange markets, especially undeveloped (for example, the Ukrainian Exchange), quite often (and especially on the day of expiration of a quarterly index futures between 16:30-16:35) stops have no time to work and the cup is filled with limit orders, which under normal conditions, would immediately lead to execution.

So - Limit in market - firm commitment to buy / sell (if money suddenly become scarce, the broker can remove the order, but earlier than it will come to execution), while STOP - simply a record on the server broker, so at the moment of reaching activation price the broker can estimate free funds and decide - expose limit or not. That's why I'm saying that for limits the limits must be met, while for stops, in theory, they don't have to be.

Thanks for the detailed explanation.

Valery, have you tried to implement an auto-strategy in MT5? I tried it about a month ago and it did not work, no one answered on the forum. I don't understand if it is a bug or a misunderstanding on my part. Shed some light. :)

 

Good afternoon!

Please advise, I have an iCustom indicator in a regular program body, it works fine and gets a handle, everything works.

If I place it to EX5 library I get indicator handle=-1 and the main program fails to call the indicator:

"loading of DZMACD EURGBP,M15 failed"
"cannot load custom indicator 'DZMACD' [4002]"

At the same time standard indicators, like iMA or iMACD, work normally in the same ex5 library, they get the handle.

I don't know what I'm doing wrong or it's a bug?

Документация по MQL5: Технические индикаторы / iCustom
Документация по MQL5: Технические индикаторы / iCustom
  • www.mql5.com
Технические индикаторы / iCustom - Документация по MQL5
 
In theMqlDateTime structure

intday;// day

does it mean the day of the month?
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура даты
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура даты
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура даты - Документация по MQL5
 
victorg:

Actually, I wasn't referring to your comment, but to the NormalizeDouble() doc.

Actually, the message was worded like this:

victorg:

Yedelkin:

Did you get to DoubleToString? :)

Ah, look at NormalizeDouble:

Doesn't anything embarrass you?

That is, there was a direct quote from "my comment" with the suggestion "look something else up there" and the question "is it confusing?".

If you wanted to present only results of new research in a form "...about a dock by NormalizeDouble()" - you would write it so, without citing unnecessary information. I guess so :/

Since, however, your post used a named reference and exactly to my replica - had to clarify that NormalizeDouble() had nothing to do with my replica or your original post, which I took the liberty of commenting on.

 
Fia:

Good afternoon!

Please advise, I have iCustom indicator in the usual body of the program works fine, it gets handel, everything works.

If I place it to EX5 library I get Handel= -1 and the main program fails to call the indicator:

"loading of DZMACD EURGBP,M15 failed"
"cannot load custom indicator 'DZMACD' [4002]"

At the same time, standard indicators, like iMA or iMACD work fine in the same ex5 library, they get the handle.

I can not understand what I'm doing wrong or it's a bug?

Are the custom indicator settings in the library OK?

ERR_WRONG_INTERNAL_PARAMETER

4002

Erroneous parameter in internal client terminal function call