Orders Execution
Miscellaneous
0
Views
0
Downloads
0
Favorites
Profitability Reports
GBP/CAD
Oct 2024 - Jan 2025
0.00 %
Total Trades
0
Won Trades
0
Lost trades
0
Win Rate
0.0 %
Expected payoff
0.00
Gross Profit
0.00
Gross Loss
0.00
Total Net Profit
0.00
-100%
-50%
0%
50%
100%
GBP/USD
Oct 2024 - Jan 2025
0.00 %
Total Trades
0
Won Trades
0
Lost trades
0
Win Rate
0.0 %
Expected payoff
0.00
Gross Profit
0.00
Gross Loss
0.00
Total Net Profit
0.00
-100%
-50%
0%
50%
100%
_Open_LOCK
//+------------------------------------------------------------------+
//| _Open_LOCK.mq4 |
//| "ÑÊÐÈÏÒÛ ÄËß ËÅÍÈÂÎÃÎ" |
//| Ñêðèïò îòêðûâàåò îäèí LOCK äëÿ âñåõ îòêðûòûõ ïîçèöèé |
//| (åñëè õâàòèò äåíþøêè) |
//| Bookkeeper, 2006, yuzefovich@gmail.com |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
#property show_inputs // Åñëè åñòü æåëàíèå ìåíÿòü ýêñòåðíû â ïðîöåññå
//----
extern int DistSL = 35; // StopLoss â ïóíêòàõ
extern int DistTP = 35; // TakeProfit â ïóíêòàõ
extern int Slippage = 7; // Ïðîñêàëüçûâàíèå
extern bool StopLoss = true; // Ñòàâèòü èëè íåò
extern bool TakeProfit = true; // Ñòàâèòü èëè íåò
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void start()
{
int Total, i, Pos, Error, MinLotDgts;
int Result;
double MinLot = MarketInfo(Symbol(), MODE_MINLOT);
double SL = 0, TP = 0, Stake, BuyLots = 0, SellLots = 0;
Total = OrdersTotal();
if(Total > 0) // Åñëè åñòü îðäåðà
{
for(i = Total - 1; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == true)
{
Pos = OrderType();
Stake = OrderLots();
if((OrderSymbol() == Symbol()) &&
(Pos == OP_BUY || Pos == OP_SELL)) // Ñìîòðèì òîëüêî îòêðûòûå Buy è Sell
{ // â àêòèâíîì îêíå
if(Pos == OP_BUY)
BuyLots = BuyLots + Stake; // Ñóììèðóåì Ëîòû îòêðûòûõ Buy
else
SellLots = SellLots + Stake; // Ñóììèðóåì Ëîòû îòêðûòûõ Sell
}
}
}
if(MinLot < 0.1)
MinLotDgts = 2;
else
if(MinLot < 1.0)
MinLotDgts = 1;
else
MinLotDgts = 0;
Stake = NormalizeDouble(BuyLots - SellLots, MinLotDgts);
if(Stake != 0) // Åñëè åñòü ÷òî ËÎÊèðîâàòü
{
if(Stake > 0) // ËÎÊèðóåì ïðîäàæåé
{
RefreshRates();
if(StopLoss == true)
SL = NormalizeDouble(Ask + DistSL*Point, Digits);
if(TakeProfit == true)
TP = NormalizeDouble(Bid - 2*DistTP*Point, Digits);
Result = OrderSend(Symbol(), OP_SELL, Stake, Bid, Slippage, SL, TP, "");
}
else // ËÎÊèðóåì ïîêóïêîé
{
RefreshRates();
Stake = -Stake;
if(StopLoss == true)
SL = NormalizeDouble(Bid - DistSL*Point, Digits);
if(TakeProfit == true)
TP = NormalizeDouble(Ask + 2*DistTP*Point, Digits);
Result = OrderSend(Symbol(), OP_BUY, Stake, Ask , Slippage, SL, TP, "");
}
if(Result <= 0)
{
Error = GetLastError();
Alert("_Open_LOCK: LastError = ", Error);
}
else
Error = 0;
}
else
Alert("_Open_LOCK: BuyLots = SellLots");
}
return(0);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---