Features of the mql5 language, subtleties and tricks - page 337

 
fxsaber #:

Brilliant work! Perhaps MQ should consider this solution as a replacement for its standard functions.

The performance boost here is of great practical significance – Tester.

I added these functions into TimeUtils libray (here https://www.mql5.com/en/code/53970).

Any suggestions would be great. Thank you.

High-Performance Time Functions (TimeUtils)
High-Performance Time Functions (TimeUtils)
  • 2024.12.03
  • www.mql5.com
High-performmance functions for dealing with time.
 
fxsaber #:
Based on this discussion, I did a quick calculation (performance is needed, as it is used in this project) of the position duration.

You can get all public holidays in a specific country for year.

https://date.nager.at/scalar/#api-version-4/tag/holidays/GET/api/v4/Holidays/{countryCode}/{year}

Send a GET request via WebRequest() function, then parse its response.

A cache of results could be built/saved.

 
amrali #:
I have added these functions to the TimeUtils library (available here: https://www.mql5.com/en/code/53970).
Why is it still version 1.55 from 2024?
 
Botan626 #:
Why is it still version 1.55 from 2024?

Good observation.

The russian version of the code base page does not update automatically with the English version!

I will update it now, thank you.

Edit:

Interesting!

I can't find the edit button, any ideas?

Please view it on the english section:

https://www.mql5.com/en/code/53970

High-Performance Time Functions (TimeUtils)
High-Performance Time Functions (TimeUtils)
  • 2024.12.03
  • www.mql5.com
High-performmance functions for dealing with time.
 
amrali #:

Good observation.

The russian version of the code base page does not update automatically with the English version!

I will update it now, thank you.

Edit:

Interesting!

I can't find the edit button, any ideas?

Please view it on the english section:

https://www.mql5.com/en/code/53970

Hello Amrali.

Ive actually used some of your code, but cannot find any license on it. What's the prerequisite under which I can use your code?
 
Dominik Egert #:
What's the prerequisite under which I can use your code?

By default, the general rule, sitewide, is:

4.4. The User shall not upload, post or otherwise make available on www.mql5.com any material protected by intellectual property law (including copyright, trademark law, etc.) or other proprietary right without the express permission of the owner of the copyright, trademark or other proprietary right. The burden of determining that any material posted by the User on www.mql5.com is not protected by copyright, neighboring or third party rights rests with the User. (https://www.mql5.com/en/about/terms).

Outside of this website, there is an even more general rule of default copyright─even where no copyright is expressly reserved. An exception to copyright is where the user of 3rd party work uses that work to create a "substantially different" work deemed to be a "new work."

I should note that proving that an ex5 file contains someone else's work is almost impossible. Presumably, that is why Metaquotes shifts the burden onto the User.

 
Dominik Egert #:
Hello Amrali.

Ive actually used some of your code, but cannot find any license on it. What's the prerequisite under which I can use your code?

This code is released into the public domain. You may use, modify, copy, or distribute it without restriction.

 
amrali #:

This code is released into the public domain. You may use, modify, copy, or distribute it without restriction.

"[E]xpress permission of the owner of the copyright..." ☝
 
amrali #:

This code is released into the public domain. You may use, modify, copy, or distribute it without restriction.

Thank you. I actually took it from forge. Dont know if its under same liberations.
 
Dominik Egert #:
Thank you. I actually took it from forge. Dont know if its under same liberations.
'"[R]eleased into the public domain" means total freedom─anytime, anywhere, and for everyone.