Orders Execution
Miscellaneous
0
Views
0
Downloads
0
Favorites
Profitability Reports
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%
NZD/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%
BUY LIMIT
//+------------------------------------------------------------------+
//| Gurion.mq4 |
//| Copyright © 2006, MetaQuotes Software Corp. |
//| http://forum.alpari-idc.ru/showthread.php?p=563517 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link "http://forum.alpari-idc.ru/showthread.php?p=563517"
#property show_inputs
#include <stdlib.mqh>
extern int TakeProffit = 100;
extern int StopLoss = 200;
extern string type = "BUY LIMIT";
extern string symbol = "EURUSD";
extern double price = 0;
extern double Lots = 1;
extern int count = 1;
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
int cmd = 0;
double stoploss = 0,
takeprofit = 0;
if (!IsConnected())
{
Alert("Ñâÿçü îòñóòñòâóåò");
return (0);
}
if (!IsTradeAllowed())
{
Alert("Òîðãîâëÿ çàïðåùåíà");
return (0);
}
if (type == "BUY STOP")
cmd = OP_BUYSTOP;
else if (type == "SELL STOP")
cmd = OP_SELLSTOP;
else if (type == "BUY LIMIT")
cmd = OP_BUYLIMIT;
else if (type == "SELL LIMIT")
cmd = OP_SELLLIMIT;
else
return (0);
if ((cmd == OP_BUYSTOP) || (cmd == OP_BUYLIMIT))
{
stoploss = price - StopLoss * MarketInfo(symbol, MODE_POINT);
takeprofit = price + TakeProffit * MarketInfo(symbol, MODE_POINT);
}
if ((cmd == OP_SELLSTOP) || (cmd == OP_SELLLIMIT))
{
stoploss = price + StopLoss * MarketInfo(symbol, MODE_POINT);
takeprofit = price - TakeProffit * MarketInfo(symbol, MODE_POINT);
}
Print(takeprofit+":"+stoploss);
for (int i = 0; i < count; i++)
{
int ticket = OrderSend(symbol,
cmd,
NormalizeDouble(Lots, 1),
NormalizeDouble(price, MarketInfo(symbol, MODE_DIGITS)),
3,
NormalizeDouble(stoploss, MarketInfo(symbol, MODE_DIGITS)),
NormalizeDouble(takeprofit, MarketInfo(symbol, MODE_DIGITS)), "", 0, 0, CLR_NONE);
if (ticket < 0)
{
int err = GetLastError();
Print("OrderSend failed with error #", ErrorDescription(err));
return (0);
}
Sleep(1000);
while (IsTradeContextBusy())
{ Sleep(100); }
}
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
---