Errors, bugs, questions - page 2053

 

Why is the compiler skipping this? (MT4/MT5).

double x=1;
double a=1/(x*0);

Only at runtime does division by 0 pop up.

 
Kirill Belousov:

Why is the compiler skipping this? (MT4/MT5).

Only at runtime does division by 0 pop up.

Probably because the compiler doesn't calculate the value, it just translates the program code into machine code.

 
What about the signal ranking?

I'm either in last place or in the middle
 

What's wrong with the Gann grid in MT5? Can't move the ends of the control line along the Y axis?

 
In the strategy tester, when the code has autocomplete replacements for instance variables in the form of comments, then in the optimisation settings super, but after optimisation the real variable names are in the table. It's confusing - you have to look into the code all the time.
 

Dear Administration.

Bug in the MT5 Strategy Tester report 1653

broker ActiveTrades

my Expert Advisor first opens a position, then it modifies the stops (SYMBOL_TRADE_EXECUTION_MARKET)

This is shown in the logs normally.

But when saving the report! there are no stops in the report.

SYMBOL_FILLING_MODE=3 SYMBOL_TRADE_EXEMODE=2 SYMBOL_EXPIRATION_MODE=7 SYMBOL_TRADE_MODE=4 SYMBOL_TRADE_STOPS_LEVEL=0 SYMBOL_TRADE_FREEZE_LEVEL=0 SYMBOL_ORDER_MODE=127 SYMBOL_START_TIME=0 SYMBOL_EXPIRATION_TIME=0 SYMBOL_SPREAD=5 SYMBOL_SESSION_DEALS=0
IE      0       09:43:35.667    Core 1  2017.08.01 02:10:00   market buy 0.01 EURUSD (1.18278 / 1.18283 / 1.18278)
JP      0       09:43:35.667    Core 1  2017.08.01 02:10:00   deal #2  buy 0.01 EURUSD at 1.18283 done (based on order #2)
 OH      0       09:43:35.667    Core 1  2017.08.01 02:10:00   deal performed [#2  buy 0.01 EURUSD at 1.18283]
LN      0       09:43:35.667    Core 1  2017.08.01 02:10:00   order performed buy 0.01 at 1.18283 [#2  buy 0.01 EURUSD at 1.18283]
EQ      0       09:43:35.667    Core 1  2017.08.01 02:10:00   ModifyOrders Modify  2 POSITION_TYPE=0 stoploss=1.17678 takeprofit=0.0 request.sl=1.17678 request.tp=0.0 POSITION_SL=0.0 POSITION_TP=0.0 SYMBOL_BID=1.18278 SYMBOL_ASK=1.18283 stops_level=0
OR      0       09:43:35.667    Core 1  2017.08.01 02:10:00   position modified [#2  buy 0.01 EURUSD 1.18283 sl: 1.17678]
DE      0       09:43:35.667    Core 1  2017.08.01 02:10:00   ModifyOrders Modify = 10009 symbol EURUSD volume 0.0 action 6 tp 0.0 sl 1.17678 type 0 price 0.0   Request completed
CL      0       09:43:35.667    Core 1  2017.08.01 02:10:00   Result = 10009 symbol EURUSD volume 0.0 action 6 tp 0.0 sl 1.17678 type 0 price 0.0   Request completed


Stop Loss and Take Profit fields are empty.


This happens only on SYMBOL_TRADE_EXECUTION_MARKET.

Although when I close by Stop Loss, everything is set correctly...

 
Alexey Viktorov:

Probably because the compiler doesn't calculate the value, it just translates the program code into machine code.

If the denominator is a constant, e.g. x/(5*0), the error is detected at compile time.

i.e. the compiler doesn't just translate the code, it performs the calculation.

It seems to me that the compiler should detect a case where the denominator is a product in which one of the terms is 0 (constant), then the compiler should produce a division by 0 error.

 
FileReadArray() does not read an array of data when the file size exceeds INT_MAX bytes.
 
Roffild:
FileReadArray() does not read data array when file size exceeds INT_MAX bytes.

It's not a FileReadArray, it's an array that can't be bigger than that size. Not an error, this is by design.

 
Kirill Belousov:

If the denominator is a constant, e.g. x/(5*0), the error is detected at compile time.

i.e. the compiler doesn't just translate the code, it performs the calculation.

It seems to me that the compiler should detect a case where the denominator is a product in which one of the terms is 0 (constant), then the compiler should produce a division by 0 error.

Do you know a language and its compiler that can catch such errors?

Reason: