Errors, bugs, questions - page 2986

 
Andrey Dik:

and, consequently, another question arises: should I check MqlTick structure for correct values after filling it with SymbolInfoTick () function? - Because the values of Ask and Bid can be any, including negative. Or it's enough to get true from SymbolInfoTick ()?

Forum on trading, automated trading systems and strategy testing

New MetaTrader 5 build 2755: Improvements in the Quotes window and debugger

fxsaber, 2021.02.15 03:02

Zero price COPY_TICKS_INFO-tic is an error?

void OnStart()
{
  MqlTick Ticks[];
  
  CopyTicksRange("GBPUSD", Ticks, COPY_TICKS_INFO, D'2020.10.02 23:54:54' * 1000, D'2020.10.05 00:07:01' * 1000);
    
  ArrayPrint(Ticks);
  Print(AccountInfoString(ACCOUNT_SERVER));
}


Result.

                         [time]   [bid]   [ask] [last] [volume]    [time_msc] [flags] [volume_real]
        [0] 2020.10.02 23:54:54 1.29378 1.29385 0.0000        0 1601682894091       4       0.00000
        [1] 2020.10.02 23:54:54 1.29377 1.29383 0.0000        0 1601682894404     134       0.00000
        [2] 2020.10.02 23:54:54 1.29375 1.29379 0.0000        0 1601682894471     134       0.00000
        [3] 2020.10.02 23:54:55 1.29375 1.29381 0.0000        0 1601682895248       4       0.00000
        [4] 2020.10.05 00:06:14 0.00000 1.29313 0.0000        0 1601856374091       6       0.00000
        [5] 2020.10.05 00:07:00 1.29271 1.29332 0.0000        0 1601856420497     134       0.00000
        [6] 2020.10.05 00:07:00 1.29271 1.29331 0.0000        0 1601856420497       4       0.00000
        RannForex-Server
 
inwinterborn:

Can you tell me why breakpoints move to the next function during debugging, both on history and online (Ctrl+F5, F5)?

Checked it several times. All explanations are in the attached screenshots.

Is this a bug?


Explanation:

1. I manually set 2 breakpoints: 1) Series.mqh line 81; 2) TimeSeries.mqh line 48
2. I move to the ExpertMACD.mq5 file
3. Start debugging on historical or real data
4. I get the debugger stop in the file Series.mqh at the line 94, which has no breakpoint. The line is the start of the next function after my manual breakpoint, which from line 81 has disappeared or moved.
5. I check my second manual breakpoint in TimeSeries.mqh, and I see that it too has moved from line 48 to line 63, again the next function after my former breakpoint.


Can you please tell me what the problem could be?

 
inwinterborn:


Explanation:

1. I manually set 2 breakpoints: 1) Series.mqh line 81; 2) TimeSeries.mqh line 48
2. I move to the ExpertMACD.mq5 file
3. Start debugging on historical or real data
4. I get the debugger stop in the file Series.mqh at the line 94, which has no breakpoint. The line is the start of the next function after my manual breakpoint, which from line 81 has disappeared or moved.
5. I check my second manual breakpoint in TimeSeries.mqh, and I see that it too has moved from line 48 to line 63, again the next function after my former breakpoint.


Can you please tell me what the problem could be?

Check the settings in the editor - turn off optimisation:

 
Vladimir Karputov:

Check the settings in the editor - disable optimisation:

Thanks for the reply, but it doesn't help.

The option was indeed enabled.

Disabled it. Repeated it. Result is the same as described above.

Closed terminal and editor with new setting.

Reopened it again. Repeated. Result is the same.

What else could be the problem?


 
inwinterborn:

Thanks for the reply, but it doesn't help.

The option was indeed enabled.

Deactivated it. Repeated it. Result is the same as described above.

Closed terminal and editor with new setting.

Reopened it again. Repeated. Result is the same.

What else could be the problem?


Try version 2833 - maybe something has changed...

 
Vladimir Karputov:

Try version 2833 - maybe something has changed ...

There was an automatic upgrade to 2834.

Result is unchanged. Breakpoints are shifting.

 
fxsaber:

Your code doesn't check the return value of the function, so it's impossible to judge about the correctness of the Ticks structure's contents.

And if there are no errors when callingCopyTicksRange, then we should consider zero values of the structure as normal, otherwise who can we trust? What prices can be considered normal at all (we mean even not 0.0 prices, but !any! prices)? Who to complain in case of wrong prices, the Sportlotto? The broker will blame the MQs and the MQs will blame the broker. The issue is more serious than it may seem.

 
Andrey Dik:

Your code doesn't check the return value of the function, so it's impossible to judge about the correctness of the Ticks structure's contents.

And if there are no errors when callingCopyTicksRange, you should consider zero values of the structure as normal, otherwise who can you trust? What prices can be considered normal at all (we mean even not 0.0 prices, but !any! prices)? Who to complain in case of wrong prices, the Sportlotto? The broker will blame MQ and MQ will blame the broker. The issue is more serious than it may seem.

The code shows what prices can be. Looked at my own codes. Don't do these and other stupid checks. Have definitely done over a million trades in various places on MT5 alone. The question is very far from practice.

 
fxsaber:

The code shows what the prices can be. Looked at my own codes. Don't do these and other stupid checks. Have definitely done over a million trades in various places on MT5 alone. The question is very far from practice.

So? That's the thing, prices can be anything, so which ones do you think are right? You don't do these and other dumb checks, but you doequally dumb, but much more expensive 0.0 value checks?

 
inwinterborn:

Can you tell me why breakpoints move to the next function when debugging, both on history and online (Ctrl+F5, F5)?

Checked it several times. All explanations are in the attached screenshots.

Is this a bug?

Breakpoint is shifted - as in CSeries::BufferResize expert never goes in at all.