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
|
||||
- `chartbefore.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
@@ -0,0 +1,45 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| ChartBefore.mq5 |
|
||||
//| J.S. 2013 |
|
||||
//| http://www.eselstreckdich.de |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "J.S. 2013"
|
||||
#property link "http://www.eselstreckdich.de"
|
||||
#property version "1.00"
|
||||
//+------------------------------------------------------------------+
|
||||
//| Script program start function |
|
||||
//+------------------------------------------------------------------+
|
||||
void OnStart()
|
||||
{
|
||||
//---
|
||||
long current=ChartID();
|
||||
long before=current;
|
||||
|
||||
while(true)
|
||||
{
|
||||
long id=ChartNext(before);
|
||||
if(id==-1) id=ChartFirst();
|
||||
if(id==current) break;
|
||||
before=id;
|
||||
}
|
||||
|
||||
ChartBringToTop(before);
|
||||
}
|
||||
//+----------------------------------------------------------------------+
|
||||
//| Send command to the terminal to display the chart above all others. |
|
||||
//+----------------------------------------------------------------------+
|
||||
bool ChartBringToTop(const long chart_ID=0)
|
||||
{
|
||||
//--- reset the error value
|
||||
ResetLastError();
|
||||
//--- show the chart on top of all others
|
||||
if(!ChartSetInteger(chart_ID,CHART_BRING_TO_TOP,0,true))
|
||||
{
|
||||
//--- display the error message in Experts journal
|
||||
Print(__FUNCTION__+", Error Code = ",GetLastError());
|
||||
return(false);
|
||||
}
|
||||
//--- successful execution
|
||||
return(true);
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
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