[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 160
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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);
}