"code isn't working" means nothing!!
But MQ5 has instruments for to find and correct the problem yourself:
Code debugging: https://www.metatrader5.com/en/metaeditor/help/development/debug
Error Handling and Logging in MQL5: https://www.mql5.com/en/articles/2041
Tracing, Debugging and Structural Analysis of Source Code, scroll down to: "Launching and Debuggin": https://www.mql5.com/en/articles/272
If we should help you have to clearly document the problem (line, error message, ...) with your code as the official codes are correct in actually all cases. Please use the the code button: or Alt+S.
Code debugging - Developing programs - MetaEditor Help
- www.metatrader5.com
MetaEditor has a built-in debugger allowing you to check a program execution step by step (by individual functions). Place breakpoints in the code...

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I tried to use MQL5 different documentation codes for CalenderValue but they aren't working (I also changes the dates but still didn't work).
Here are the links for some of the codes:
https://www.mql5.com/en/docs/calendar/calendarvaluehistory
https://www.mql5.com/en/docs/calendar/calendarvaluelast
https://www.mql5.com/en/docs/constants/structures/mqlcalendar#mqlcalendarvalue_sample
If someone can help me I'll really appreciate it.