Initial commit: MQL5 Scripts Collection (MetaTrader 5)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# 🚀 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
|
||||
- `ThirdPartyTicks.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1 @@
|
||||
// https://www.mql5.com/ru/code/20225␍#property script_show_inputs␍␍#include <fxsaber\ThirdPartyTicks\ThirdPartyTicks.mqh>␍␍sinput bool Sync = true; // Synchronization␍sinput string symbol = ""; // Symbol (NULL - current, "AllSymbols" - All)␍␍THIRDPARTYTICKS ThirdPartyTicks; // Ïîäêëþ÷èëèñü ê ëîêàëüíîìó àðõèâó êîòèðîâîê␍␍// Îäèí ñèìâîë␍void CreateSymbol()␍{␍ // Îïðåäåëèëèñü ñ ñèìâîëîì äëÿ ðàáîòû␍ const string Symb = (symbol == "") ? StringSubstr(_Symbol, 0, 6) : symbol;␍␍ if (Sync)␍ ThirdPartyTicks.Refresh(); // Ïðî÷ëè äîñòóïíûå äàííûå íà èñòî÷íèêå àðõèâà òèêîâ␍␍ ThirdPartyTicks[Symb].Update(false); // Ñèíõðîíèçèðîâàëè ëîêàëüíûé àðõèâ ñ èñòî÷íèêîì ïî âûáðàííîìó ñèìâîëó␍ ThirdPartyTicks[Symb].ToCustomSymbol(Sync, true); // Ñîçäàëè êàñòîìíûé ñèìâîë íà îñíîâå ëîêàëüíîãî àðõèâà␍}␍␍// Âñå ñèìâîëû␍void CreateAllSymbols( const bool ToSymbols = true )␍{␍ if (Sync)␍ {␍ ThirdPartyTicks.Refresh(); // Ïðî÷ëè äîñòóïíûå äàííûå íà èñòî÷íèêå àðõèâà òèêîâ␍␍ Print("OnlineArchive's size is " + (string)(ThirdPartyTicks.GetSize() >> 20) + " Mb.");␍ }␍␍ const ulong TotalSize = ThirdPartyTicks.GetSize(Sync);␍␍ const uint Amount = ThirdPartyTicks.GetAmount();␍ ulong CalcSize = 0;␍␍ const uint StartTime = GetTickCount();␍␍ for (uint i = 0; _CS(i < Amount); i++)␍ {␍ Print("Symbol " + ThirdPartyTicks[i].GetName() + " " + (string)(i + 1) + "/" + (string)Amount);␍␍ ThirdPartyTicks[i].Update(false); // Ñèíõðîíèçèðîâàëè ëîêàëüíûé àðõèâ ñ èñòî÷íèêîì ïî âûáðàííîìó ñèìâîëó␍␍ if (_CS(ToSymbols))␍ ThirdPartyTicks[i].ToCustomSymbol(Sync); // Ñîçäàëè êàñòîìíûé ñèìâîë íà îñíîâå ëîêàëüíîãî àðõèâà␍␍ const uint Interval = (GetTickCount() - StartTime) / 1000;␍␍ CalcSize += ThirdPartyTicks.GetSize(Sync, ThirdPartyTicks[i].GetName());␍ const uint EstimatedTime = CalcSize ? (uint)(Interval * TotalSize / CalcSize) : 0;␍␍ if (_CS(true))␍ {␍ const string Str = "Done " + (string)(i + 1) + "/" + (string)Amount + " symbols, Time = " +␍ TimeToString(Interval, TIME_SECONDS) + " / " + TimeToString(EstimatedTime, TIME_SECONDS) +␍ " (" + (EstimatedTime ? DoubleToString(100.0 * Interval / EstimatedTime, 2) : "0") +␍ "%), Time Left = " + TimeToString(EstimatedTime - Interval, TIME_SECONDS) +␍ " (" + (string)(TimeLocal() + EstimatedTime - Interval) + ")";␍␍ Print(Str);␍ Comment(MQLInfoString(MQL_PROGRAM_NAME) + " " + (string)TimeLocal() + "\n" + Str + "\nSee the logs.");␍ }␍ }␍␍ if (_CS(true) && (ToSymbols || Sync))␍ Alert((ToSymbols ? "Created " : "Downloaded ") + (string)Amount + " symbols (See the logs).");␍␍ Comment("");␍}␍␍void OnStart()␍{␍ if (symbol != "AllSymbols")␍ CreateSymbol();␍ else if (MessageBox("Creating all the symbols can take a long time.\nCurrent size of Offline archive is " +␍ (string)(ThirdPartyTicks.GetSize(false) >> 20) + " Mb.\nDo you agree?", __FILE__, MB_YESNO | MB_ICONQUESTION) == IDYES)␍ CreateAllSymbols();␍}
|
||||
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 |
Reference in New Issue
Block a user