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
|
||||
- `time_left_to_new_bar_watch.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: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,78 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| Time Left To New Bar Watch.mq5 |
|
||||
//| Copyright 2023, Igor Gerasimov. |
|
||||
//| tgwls2@gmail.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2023, Igor Gerasimov."
|
||||
#property link "tgwls2@gmail.com"
|
||||
#property version "1.00"
|
||||
#property script_show_inputs
|
||||
input string name="Arrow_"; // Object Prfx
|
||||
input uchar font_size=25; // Object Size
|
||||
input color clr0=clrDarkGreen, // Marker Color
|
||||
clr1=clrOlive; // Arrow Color
|
||||
uchar dpi=font_size;
|
||||
//+------------------------------------------------------------------+
|
||||
//| Script program start function |
|
||||
//+------------------------------------------------------------------+
|
||||
void OnStart()
|
||||
{
|
||||
const int x0=(int)ChartGetInteger(0,CHART_WIDTH_IN_PIXELS,0),
|
||||
y0=(int)ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS,0),
|
||||
x=(int)(x0/(double)2),
|
||||
y=(int)(y0/(double)2),
|
||||
z3=(int)(MathMax(x0,y0)/(double)3),
|
||||
z6=(int)(MathMax(x0,y0)/(double)6);
|
||||
dpi*=(uchar)(MathMax(TerminalInfoInteger(TERMINAL_SCREEN_DPI)/(double)96,MathMax(x0,y0)/(double)566));
|
||||
double time=0;
|
||||
for(int i=0; i<12 && !IsStopped(); i++)
|
||||
{
|
||||
Label(name+(string)i,(int)(x+MathSin(time*M_PI)*z3),(int)(y+MathSin((time-0.5)*M_PI)*z3),dpi,0-360*time/2,"|",clr0);
|
||||
time+=2/(double)12;
|
||||
}
|
||||
time=0;
|
||||
Label(name+(string)12,(int)(x+MathSin(time*M_PI)*z6),(int)(y+MathSin((time-0.5)*M_PI)*z6),dpi*4,0-360*time,"|",clr1);
|
||||
ChartRedraw(0);
|
||||
while(!IsStopped())
|
||||
{
|
||||
time=((int)TimeCurrent()-(int)iTime(_Symbol,PERIOD_CURRENT,0)+1)*2/(double)PeriodSeconds(PERIOD_CURRENT);
|
||||
ObjectSetInteger(0,name+(string)12,OBJPROP_XDISTANCE,(int)(x+MathSin(time*M_PI)*z6));
|
||||
ObjectSetInteger(0,name+(string)12,OBJPROP_YDISTANCE,(int)(y+MathSin((time-0.5)*M_PI)*z6));
|
||||
ObjectSetDouble(0,name+(string)12,OBJPROP_ANGLE,0-360*time/2);
|
||||
ChartRedraw(0);
|
||||
Sleep(99);
|
||||
}
|
||||
for(int i=0; i<13; i++) ObjectDelete(0,name+(string)i);
|
||||
ChartRedraw(0);
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
//| Label |
|
||||
//+------------------------------------------------------------------+
|
||||
void Label(const string n,
|
||||
const int x,
|
||||
const int y,
|
||||
const int z,
|
||||
const double a,
|
||||
const string t,
|
||||
const color c)
|
||||
{
|
||||
if(ObjectCreate(0,n,OBJ_LABEL,0,0,0))
|
||||
{
|
||||
ObjectSetInteger(0,n,OBJPROP_XDISTANCE,x);
|
||||
ObjectSetInteger(0,n,OBJPROP_YDISTANCE,y);
|
||||
ObjectSetInteger(0,n,OBJPROP_CORNER,CORNER_LEFT_UPPER);
|
||||
ObjectSetString(0,n,OBJPROP_TEXT,t);
|
||||
ObjectSetString(0,n,OBJPROP_FONT,"Arial Black");
|
||||
ObjectSetInteger(0,n,OBJPROP_FONTSIZE,z);
|
||||
ObjectSetDouble(0,n,OBJPROP_ANGLE,a);
|
||||
ObjectSetInteger(0,n,OBJPROP_ANCHOR,ANCHOR_CENTER);
|
||||
ObjectSetInteger(0,n,OBJPROP_COLOR,c);
|
||||
ObjectSetInteger(0,n,OBJPROP_BACK,true);
|
||||
ObjectSetInteger(0,n,OBJPROP_SELECTABLE,false);
|
||||
ObjectSetInteger(0,n,OBJPROP_SELECTED,false);
|
||||
ObjectSetInteger(0,n,OBJPROP_HIDDEN,true);
|
||||
ObjectSetInteger(0,n,OBJPROP_ZORDER,LONG_MAX);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Reference in New Issue
Block a user