jarikn: Guys, help me make an alert for an indicator. I want to test a combination of different indicators, but I need an alert function. I want the alert to be shown only once when arrow appears. If you are not hard please help me write this function, I can not do it, alerts pop up a whole minute or all the time, even mt4 hangs.
Another question. Why is this indicator a heavy load on the CPU? I open 10 currency pairs and mt4 gets really bogged down. As a forex trading robot, you should use the mt4 indicators as an indicators.
Hi all, I have an indicator that shows the angle of the trend in degrees (not normalised though). Everything is great on the chart. It can be on the angle curve itself (blue) or on its mean curve (green) - Fig. 1. When calling the indicator in the Expert Advisor through double Custom = iCustom(Symbol(), window, "Angle", 0, 1), the program produces some huge numbers - Figure 2. The dialog window - chart period, "Angle" - indicator name, 0 - zero buffer where the blue line is calculated (I can put 1 - green MA buffer, but the result will be similar), 1 - shift. What could be the problem?
Свойства объектов - Константы объектов - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
I have written an EA and everything seems to be working. But the thing is that orders should be closed at crossing of slips. To be more precise, only the first order is closed, and it doesn't matter which way it went, then the log generates error OrderClose error 4051. What is the problem?
//-----------------------------------------------------------if (CountSell() == 0 && mama1<mama2 && cci>verh && cci1>verh && cci<cci1)
{
tiket = OrderSend(Symbol(), OP_SELL,Lots,Bid,Slippage,0,0,"",Magic,0, Red);
if (tiket>0)
{
SL=NormalizeDouble(Bid+StopLoss*Point,Digits);
TP=NormalizeDouble(Bid-TakeProfit*Point,Digits);
if (OrderSelect(tiket, SELECT_BY_TICKET))
if (!OrderModify(tiket,OrderOpenPrice(),SL,TP,0))
Print("Ошибка модификации ордера на продажу");
} elsePrint("Ошибка открытия ордера на продажу");
}
if (CountBuy() == 0 && mama1>mama2 && cci<nuz && cci1<nuz && cci>cci1)
{
tiket = OrderSend(Symbol(), OP_BUY,Lots,Ask,Slippage,0,0,"",Magic,0,Blue);
if (tiket>0)
{
SL=NormalizeDouble(Ask-StopLoss*Point,Digits);
TP=NormalizeDouble(Ask+TakeProfit*Point,Digits);
if (OrderSelect(tiket, SELECT_BY_TICKET))
if (!OrderModify(tiket,OrderOpenPrice(),SL,TP,0))
Print("Ошибка модификации ордера на покупку");
} elsePrint("Ошибка открытия ордера на покупку");
}
if(mama1>mama2 && CountSell()>0)
{
for(int i = OrdersTotal() -1;i>=0; i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderMagicNumber()==Magic && OrderType()==OP_SELL)
OrderClose(OrderType(),OrderLots(),Ask,Slippage,Black);
}
}
}
if(mama1<mama2 && CountBuy()>0)
{
for(int i = OrdersTotal() -1;i>=0; i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderMagicNumber()==Magic && OrderType()==OP_BUY)
OrderClose(OrderType(),OrderLots(),Bid,Slippage,Black);
}
}
}
Tango_X: Can you please tell me how to programmatically make an object selected? I haven't found anything like that in the Help
If you use the standard object creation function, the default setting is selection = true. For example, for the trend line, the 4th line from the bottom:
bool TrendCreate(constlong chart_ID = 0, // ID графикаconststring name = "TrendLine", // имя линииconstint sub_window = 0, // номер подокнаdatetime time1 = 0, // время первой точкиdouble price1 = 0, // цена первой точкиdatetime time2 = 0, // время второй точкиdouble price2 = 0, // цена второй точкиconstcolor clr = clrRed, // цвет линииconstENUM_LINE_STYLE style = STYLE_SOLID, // стиль линииconstint width = 4, // толщина линииconstbool back = false, // на заднем планеconstbool selection = true, // выделить для перемещенийconstbool ray_right = false, // продолжение линии вправоconstbool hidden = true, // скрыт в списке объектовconstlong z_order = 0) // приоритет на нажатие мышью
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Try this, it should work.
Nope. It keeps beeping an alert. Here's the whole code and the indulgences. Maybe I'm doing something wrong
Guys, help me make an alert for an indicator. I want to test a combination of different indicators, but I need an alert function. I want the alert to be shown only once when arrow appears. If you are not hard please help me write this function, I can not do it, alerts pop up a whole minute or all the time, even mt4 hangs.
Add a variable
if not a signal the variable becomes false
if (signal and variable== false) {
alert;
variable=true;
}
Add a variable
the variable becomes false if a new candle appears
if (signal and variable== false) {
alert;
variable=true;
}
will be no more than 1 per candleok. thank you.
Okay. Thank you.
I changed it there.
Hi all, I have an indicator that shows the angle of the trend in degrees (not normalised though). Everything is great on the chart. It can be on the angle curve itself (blue) or on its mean curve (green) - Fig. 1. When calling the indicator in the Expert Advisor through double Custom = iCustom(Symbol(), window, "Angle", 0, 1), the program produces some huge numbers - Figure 2. The dialog window - chart period, "Angle" - indicator name, 0 - zero buffer where the blue line is calculated (I can put 1 - green MA buffer, but the result will be similar), 1 - shift. What could be the problem?
Could you please tell me how to make an object selectable? I couldn't find anything like that in the Help
OBJPROP_SELECTED
Object selection
mql5
mql4
Can you please tell me how to programmatically make an object selected? I haven't found anything like that in the Help
If you use the standard object creation function, the default setting is selection = true. For example, for the trend line, the 4th line from the bottom: