Initial commit: MQL5 Scripts Collection (MetaTrader 5)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# 🚀 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
|
||||
- `apply_template_sohard_db_wihez_.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| apply_template_SoHarD_dB_w@®Ez_.mq5 |
|
||||
//| Copyright 2014, by _SoHarD_dB_w@®Ez_ |
|
||||
//| https://www.google.com/+RicardoPenders_SoHarD_dB_ |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2014, by _SoHarD_dB_w@®Ez_"
|
||||
#property link "https://www.google.com/+RicardoPenders_SoHarD_dB_"
|
||||
#property version "1.00"
|
||||
#property script_show_inputs
|
||||
#property description "Script to apply my template and current timeframe in all charts opened"
|
||||
#include <Charts\Chart.mqh>;
|
||||
|
||||
input ENUM_TIMEFRAMES TimeFrame; // Change TimeFrame - Current = dont changed
|
||||
input string Template="_SoHarD_dB_wyuEz_"; // Name of Template (without '.tpl')
|
||||
//+------------------------------------------------------------------+
|
||||
//| Script program start function |
|
||||
//+------------------------------------------------------------------+
|
||||
void OnStart()
|
||||
{
|
||||
long currChart,prevChart=ChartFirst();
|
||||
int i=0,limit=100;
|
||||
bool errTemplate;
|
||||
while(i<limit)
|
||||
{
|
||||
currChart=ChartNext(prevChart);
|
||||
if(TimeFrame!=PERIOD_CURRENT)
|
||||
{
|
||||
ChartSetSymbolPeriod(prevChart,ChartSymbol(prevChart),TimeFrame);
|
||||
}
|
||||
errTemplate=ChartApplyTemplate(prevChart,Template+".tpl");
|
||||
if(!errTemplate)
|
||||
{
|
||||
Print("Error ",ChartSymbol(prevChart),"-> ",GetLastError());
|
||||
}
|
||||
if(currChart<0) break;
|
||||
Print(i,ChartSymbol(currChart)," ID =",currChart);
|
||||
prevChart=currChart;
|
||||
i++;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 13 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