Initial commit: MQL5 Scripts Collection (MetaTrader 5)

This commit is contained in:
GeneralTradingSarl
2025-06-24 00:33:04 +01:00
commit 60a549d89c
1959 changed files with 31907 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

@@ -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!
---
![Screenshot](LotLine__2.png)
![Screenshot](script.png)
## Source Files
- `lotline.mq5`
---
> Made with ❤️ for the trading community.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,83 @@
//+------------------------------------------------------------------+
//| LotLine.mq5 |
//| Copyright 2015,Viktor Moss |
//| https://login.mql5.com/ru/users/vicmos |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015,Viktor Moss"
#property link "https://login.mql5.com/ru/users/vicmos"
#property version "1.00"
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
double line,lot=0;
double bid=SymbolInfoDouble(_Symbol,SYMBOL_BID);
double ask=SymbolInfoDouble(_Symbol,SYMBOL_ASK);
if(PositionSelect(_Symbol))
{
if(PositionGetDouble(POSITION_PRICE_OPEN)<bid)
line=(bid+PositionGetDouble(POSITION_PRICE_OPEN))/2;
else
line=(ask+PositionGetDouble(POSITION_PRICE_OPEN))/2;
}
else
{
line=(ChartGetDouble(0,CHART_PRICE_MAX)+ChartGetDouble(0,CHART_PRICE_MIN))/2;
}
if(ObjectFind(0,"LotLine")<0)
{
ObjectCreate(0,"LotLine",OBJ_HLINE,0,0,line);
ObjectSetInteger(0,"LotLine",OBJPROP_SELECTABLE,true);
ObjectSetInteger(0,"LotLine",OBJPROP_COLOR,clrYellowGreen);
}
ObjectSetDouble(0,"LotLine",OBJPROP_PRICE,line);
ObjectSetInteger(0,"LotLine",OBJPROP_SELECTED,true);
//--- Loop
while(!IsStopped())
{
line=ObjectGetDouble(0,"LotLine",OBJPROP_PRICE);
SetText("LotLine1","Line "+DoubleToString(line,_Digits),130,65);
if(PositionSelect(_Symbol))
{
bid=SymbolInfoDouble(_Symbol,SYMBOL_BID);
ask=SymbolInfoDouble(_Symbol,SYMBOL_ASK);
long pt=PositionGetInteger(POSITION_TYPE);
double cur=pt==POSITION_TYPE_BUY?ask:bid;
double pr_open=PositionGetDouble(POSITION_PRICE_OPEN);
double lt=PositionGetDouble(POSITION_VOLUME);
if(line-cur!=0)lot=(pr_open-line)/(line-cur)*lt;
lot=lot<0?0:lot;
}
else
{
lot=0;
}
//---
SetText("LotLine2","Lot "+DoubleToString(lot,4),130,45);
ChartRedraw();
Sleep(50);
}
//--- End loop
ObjectDelete(0,"LotLine1");
ObjectDelete(0,"LotLine2");
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void SetText(string name,string text,int x,int y,color col=clrYellow,int r=11,long chid=0)
{
if(ObjectFind(chid,name)<0)
{
ObjectCreate(chid,name,OBJ_LABEL,0/*ChartWindowFind()*/,0,0);
ObjectSetInteger(chid,name,OBJPROP_CORNER,CORNER_RIGHT_UPPER);
}
ObjectSetInteger(chid,name,OBJPROP_XDISTANCE,x);
ObjectSetInteger(chid,name,OBJPROP_YDISTANCE,y);
ObjectSetString(chid,name,OBJPROP_TEXT,text);
ObjectSetInteger(chid,name,OBJPROP_COLOR,col);
ObjectSetInteger(chid,name,OBJPROP_FONTSIZE,r);
}
//+------------------------------------------------------------------+
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB