Errors, bugs, questions - page 1145

 
Renat:

So you give your numbers, be sure to start with zero counters, measuring 5 minutes for example on EURUSD and starting both programs at the same time.

ps: the fact that you read the counter in the inite is a good way to cheat yourself if you are sloppy. start the counter from zero if you want to do a clean experiment.

Hmmm... Thanks. Looked at the EURUSD in the DC - everything is fine. I'm counting evenly from zero.

I cannot repeat this experiment now (Moscow Exchange is closed). But it was like this during the day in active market:

ExpCount (Si-6.14,M1) OnTick_count=697
TicksCount (Si-6.14,M1) OnCalculateCount=1326

Literally a couple of minutes. Is there something wrong with the broker?

 
Fry:

Um... Thank you. Looked at the EURUSD in the DC - everything is fine. I'm counting from zero, evenly.

I cannot repeat this experiment now (The Moscow Exchange is closed). But it was so in the active market in the daytime:

ExpCount (Si-6.14,M1) OnTick_count=697
TicksCount (Si-6.14,M1) OnCalculateCount=1326

Literally a couple of minutes. Is there something wrong with the broker?

No, it doesn't depend on the broker. The terminal receives one stream of ticks that is given to both indicators and Expert Advisors.

It usually means that the indicator works fast and receives all the ticks. However, the expert is likely to delay in its calculations and cannot leave the handler before the next tick arrives. You cited a simple code as an example, but in reality you have calculated ticks on a working Expert Advisor that has performed many calculations. At the very least, it was not as empty as in the example.

As a result, the Expert Advisor skips ticks that came in faster than its handler. If you don't skip the ticks in this case, you can easily put the expert to work in the harsh past. For example, because of its costs, the Expert Advisor will receive outdated quotes for several seconds/minutes from the tick queue and read a completely outdated market profile.

 
Renat:

No.

It usually means that the indicator works quickly and receives all the ticks. The Expert Advisor, on the other hand, is most likely slow in calculations and cannot leave the handler before the next tick arrives.

As a result, the expert will skip ticks coming faster than its handler. If you do not skip ticks in this case, you can easily put the expert to work in the harsh past. For example, because of its costs, the Expert Advisor will receive outdated quotes for several seconds/minutes from the tick queue and read a completely outdated market profile.

Thank you. Got it. I suspected as much because of the queue. I just couldn't believe this empty queue was slowing down so much as almost half of the flow is flying by.
 
Renat:

We don't have an error.

You tried to insert an undocumented URL into the clip page from your browser instead of the actual documented and supported insertion URL. We can't keep track of every little change to the YouTube page engine and hack out the sharable URL based on the page URL.

Can you explain why https://www.youtube.com/watch?v=XXXXXX is considered "documented" and https://www.youtube.com/watch?v=XXXXXX "undocumented"?

This should be the regular line to check: ^https?:\/\/(www\.)?youtube\.com\/watch\?v=\S+$

 
Roffild:

Can you explain why https://www.youtube.com/watch?v=XXXXXX is "documented" and https://www.youtube.com/watch?v=XXXXXX is "undocumented"?

This is the regular line to check: https?:\/\/(www\.)?youtube\.com\/watch\?v=\S+.

If we're talking about background URL recognition in the body of the message, it's not about regularity, we're just not climbing through HTTPS resources looking for structured data.

If we're talking about the regular YouTube clips embed feature that's on the editor panel, it still produces HTTP links from YouTube for sharers like http://youtu.be/ZI67sr0RXzU even if you go in via HTTPS.


When I'm talking about documented URL, I'm only talking about what's inserted in the special "Video" button, where we only accept special urls rendered for YouTube shoring. But if you use links within the text of a post, we're trying to recognise structured data within that page to make a preview.

This is what the structured data looks like for the video:

        <meta property="og:site_name" content="YouTube">
    <meta property="og:url" content="https://www.youtube.com/watch?v=ZI67sr0RXzU">
    <meta property="og:title" content="MetaTrader 5 Strategy Tester 3D Visualization">
    <meta property="og:image" content="http://i1.ytimg.com/vi/ZI67sr0RXzU/maxresdefault.jpg">

      <meta property="og:description" content="MetaTrader 5 Strategy Tester 3D Visualization">

      <meta property="og:type" content="video">
          <meta property="og:video" content="https://www.youtube.com/v/ZI67sr0RXzU?version=3&amp;amp;autohide=1">
        <meta property="og:video:type" content="application/x-shockwave-flash">
        <meta property="og:video:width" content="960">
        <meta property="og:video:height" content="720">
and this is how it is displayed:
MetaTrader 5 Strategy Tester 3D Visualization
MetaTrader 5 Strategy Tester 3D Visualization
  • www.youtube.com
MetaTrader 5 Strategy Tester 3D Visualization
 

Greetings, gentlemen developers. How about to make possibility to initialize static constants directly in structure/class body, as it is implemented in C++:

struct TStruct {   static const int a = 10; };

This is usually much more convenient and clear, rather than removing initialization outside the class, wasting extra lines of code.

Now the compiler generates an error: '=' - illegal assignment use

 
Fry:
Thank you. Got it. I suspected it was the queue. I just couldn't believe how slow this thing was, with almost half the flow passing by.
Maybe it's not the brakes, but the flow of ticks from the trade server. If the ticks come from the server "in pack", then OnTick() of the Expert Advisor is called once per "pack" and not for each tick in it.
 
meat:

Greetings, gentlemen developers. How about to make possibility to initialize static constants directly in structure/class body, as it is implemented in C++:

This is usually much more convenient and clear, rather than removing initialization outside the class, wasting extra lines of code.

Now the compiler generates an error: '=' - illegal assignment use

There are constructors for this purpose which work for structures as well.
 
Renat:
There are constructors for this, which work for structures as well.

Constructors are designed to initialize local members of an object. And we are talking about static class variables. They are initialized either outside the class body, or in the class body at declaration place (if they are constants) - this is the second case I'm talking about, it works in C++, and in MQL it produces an error.

 
meat:

Greetings, gentlemen developers. How about making it possible to initialize static constants directly in the structure/class body, as implemented in C++:

Actually just in pluses initialization of static members is taken outside the class. Only constants of integral types can be initialized internally.