Roger: This is not the part of the code where there could be an error.
Em.... and the rest of the code is the calculation of values ( POINT_BUY_M15, POINT_BUY_H, POINT_BUY_H4, POINT_SELL_M15, POINT_SELL_H, POINT_SELL_H4 ) to make trades, it works correctly... I checked... it's simple there....
If the error was here, the log would say "Stop not set", but it's not.
The error lies exactly in that code. It closes BUY, then it selects an order which does not exist anymore and closes the intended SELL, which never existed in the first place. I think I have shown us the error. It will not be difficult to understand.
I started to study MQL in a textbook. There're enough examples in it and they're all intelligently constructed. Some of the constructions used in those examples I still use in my own developments.
The error lies exactly in that code. It closes BUY, then it selects an order, which does not exist any more, and closes SELL, which never existed at all. I think I have shown the error. It will not be difficult to understand.
I started to study MQL in a textbook. There're enough examples in it and they're all intelligently constructed. I'm still using some of those examples in my developments.
Agreed. Recommended:
datetime OrderCloseTime(
)
Returns the closing time for the selected order. Only closed orders have a closing time which is not 0. Open or pending orders have a close time equal to 0. The order must be pre-selected using OrderSelect().
Guys, help me, I'm getting lost. I'm making an indicator that I want to output as text objects the information from various other indicators from different timeframes. For example ADX. I make three iADX:
Guys, help me, I'm getting a bit confused. I'm making an indicator that I want to output as text objects the information from various other indicators from different timeframes. For example ADX. I make three iADX:
I test on H4, only one ADX, which is on H4, the other two give a constant value. Help please.
Try on M30 - if explicitly prescribed periods in the code, everything should work.
Guys, help me, I'm getting confused. I'm making an indicator that I want to output as text objects the information from various other indicators from different timeframes. For example ADX. I make three iADX:
I test on H4, only one ADX, which is on H4, the other two give a constant value. Please help.
I have a feeling I will not change my values.
Or you are outputting incorrectly, which only Misters Telepaths can know for sure...
The error lies exactly in that code. It closes BUY, then it selects an order, which does not exist any more, and closes SELL, which never existed at all. I think I have shown the error. This cannot be difficult to understand.
Before closing an order, the EA checks the magic number of the order and it is different for buy and sell orders. So, one and the same order cannot be closed as both Buy and Sell.
Here is the code:
//+-----------------------------------------------------------------------------+ //+-------------------------СТАВИМ СПОП ЛОСС ДЛЯ BUY-------------+ //+-----------------------------------------------------------------------------+
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.
How to stop the execution of the indicator ...if proc_zahlest>100
... And another question: what should the OBJ_TEXT time coordinate look like, so that the text is RIGHT of the zero candle?
Moved:
eurodollar1981 09.09.2011 10:37
Two keys -- is it a lot? If -- no, you write an appropriate script whose execution is set to the "hotkey".
Terminal --> Navigator --> Scripts --> Your script --> Right-click --> Set hotkey.
Roger:
Xaoss1990:
This is not the part of the code where there could be an error.
The error lies exactly in that code. It closes BUY, then it selects an order which does not exist anymore and closes the intended SELL, which never existed in the first place. I think I have shown us the error. It will not be difficult to understand.
I started to study MQL in a textbook. There're enough examples in it and they're all intelligently constructed. Some of the constructions used in those examples I still use in my own developments.
The error lies exactly in that code. It closes BUY, then it selects an order, which does not exist any more, and closes SELL, which never existed at all. I think I have shown the error. It will not be difficult to understand.
I started to study MQL in a textbook. There're enough examples in it and they're all intelligently constructed. I'm still using some of those examples in my developments.
Agreed. Recommended:
The order must be pre-selected using OrderSelect().
Ugh... Thank you!
Guys, help me, I'm getting lost. I'm making an indicator that I want to output as text objects the information from various other indicators from different timeframes. For example ADX. I make three iADX:
I test on H4, only one ADX, which is on H4, the other two give a constant value. Help please.
Guys, help me, I'm getting a bit confused. I'm making an indicator that I want to output as text objects the information from various other indicators from different timeframes. For example ADX. I make three iADX:
I test on H4, only one ADX, which is on H4, the other two give a constant value. Help please.
Try on M30 - if explicitly prescribed periods in the code, everything should work.
Guys, help me, I'm getting confused. I'm making an indicator that I want to output as text objects the information from various other indicators from different timeframes. For example ADX. I make three iADX:
I test on H4, only one ADX, which is on H4, the other two give a constant value. Please help.
I have a feeling I will not change my values.
Or you are outputting incorrectly, which only Misters Telepaths can know for sure...
The error lies exactly in that code. It closes BUY, then it selects an order, which does not exist any more, and closes SELL, which never existed at all. I think I have shown the error. This cannot be difficult to understand.
Before closing an order, the EA checks the magic number of the order and it is different for buy and sell orders. So, one and the same order cannot be closed as both Buy and Sell.
Here is the code:
//+-----------------------------------------------------------------------------+
//+-------------------------СТАВИМ СПОП ЛОСС ДЛЯ BUY-------------+
//+-----------------------------------------------------------------------------+
OrderSelect(0, SELECT_BY_POS, MODE_TRADES);
Magic = OrderMagicNumber();
if (OrdersTotal() == 1 && Magic == 111 && OrderType( ) == 0)
{
if (POINT_BUY_M15 < Strgh_UP_M15 || POINT_BUY_H1 < Strgh_UP_H1 || POINT_BUY_H4 < Strgh_UP_H4)
{
close = 1;
}
}
if (close == 1)
{
OrderClose(OrderTicket(), lots, Bid, 5, Yellow);
}
//+-----------------------------------------------------------------------------+
//+-------------------------СТАВИМ СПОП ЛОСС ДЛЯ SELL-------------+
//+-----------------------------------------------------------------------------+
OrderSelect(0, SELECT_BY_POS, MODE_TRADES);
Magic = OrderMagicNumber();
if (OrdersTotal() == 1 && Magic == 222 && OrderType( ) == 1)
{
if (POINT_SELL_M15 < Strgh_DOWN_M15 || POINT_SELL_H1 < Strgh_DOWN_H1 || POINT_SELL_H4 < Strgh_DOWN_H4)
{
close = 1;
}
}
if (close == 1)
{
OrderClose(OrderTicket(), lots, Ask, 5, Red);
}