Initial commit: MQL5 Scripts Collection (MetaTrader 5)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# 🚀 Unlock the Power of Trading!
|
||||
|
||||
Welcome to this open-source trading project. Here you will find powerful tools to enhance your trading journey. If you find this project useful, please consider starring ⭐, sharing, or donating to support further development!
|
||||
|
||||
---
|
||||
|
||||
**Support the project:**
|
||||
- Star this repository on GitHub
|
||||
- Share it with your trading friends
|
||||
- [Donate here](https://www.paypal.com/donate/?hosted_button_id=YOUR_BUTTON_ID) to help us grow!
|
||||
|
||||
---
|
||||

|
||||
|
||||
## Source Files
|
||||
- `subtracttime.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,48 @@
|
||||
|
||||
|
||||
int tickCont = 0; // ticks counter
|
||||
datetime tempDate = TimeCurrent();
|
||||
datetime myDateTime = "1970.01.01 00:10:00";
|
||||
string compareDates = "Nothing yet";
|
||||
|
||||
|
||||
void OnTick()
|
||||
{
|
||||
|
||||
datetime timeCurrent = TimeCurrent();
|
||||
string hourCurrent = StringSubstr(timeCurrent,11,2);
|
||||
datetime timeLocal = TimeLocal();
|
||||
string hourLocal = StringSubstr(timeLocal,11,2);
|
||||
|
||||
if (tickCont == 100)
|
||||
{
|
||||
tempDate = timeCurrent;
|
||||
}
|
||||
|
||||
if (tickCont == 200)
|
||||
{
|
||||
tempDate = timeCurrent - tempDate;
|
||||
}
|
||||
|
||||
if (tickCont == 300)
|
||||
{
|
||||
tickCont = 0;
|
||||
}
|
||||
|
||||
if (tempDate < myDateTime)
|
||||
compareDates = "Temp Date < 1970.01.01 00:10:00";
|
||||
else
|
||||
compareDates = "Temp Date > 1970.01.01 00:10:00";
|
||||
|
||||
Comment("Current Time: ", timeCurrent,
|
||||
"\nCurrent Hour: ", hourCurrent,
|
||||
"\nLocal Time: ", timeLocal,
|
||||
"\nLocal Hour: ", hourLocal,
|
||||
"\nTemporary Date: ", tempDate,
|
||||
"\nTick Counter: ", tickCont,
|
||||
"\nCompare Dates : ", compareDates);
|
||||
|
||||
tickCont++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user