Absolutely correct, only sellstop and buystop limit orders are being worked on. What needs to be fixed?
//+----------------------------------------------------------------------------+//| Автор : Ким Игорь В. aka KimIV, http://www.kimiv.ru |//+----------------------------------------------------------------------------+//| Версия : 19.02.2008 |//| Описание : Возвращает флаг торгов сегодня. |//+----------------------------------------------------------------------------+//| Параметры: |//| sy - наименование инструмента ("" - любой символ, |//| NULL - текущий символ) |//| op - операция (-1 - любая позиция) |//| mn - MagicNumber (-1 - любой магик) |//+----------------------------------------------------------------------------+bool isTradeToDay(string sy="", int op=-1, int mn=-1) {
int i, k=OrdersHistoryTotal();
if (sy=="0") sy=Symbol();
for (i=0; i<k; i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) {
if (OrderSymbol()==sy || sy=="") {
if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
if (op<0 || OrderType()==op) {
if (mn<0 || OrderMagicNumber()==mn) {
if (TimeDay (OrderOpenTime())==Day()
&& TimeMonth(OrderOpenTime())==Month()
&& TimeYear (OrderOpenTime())==Year()) return(True);
}
}
}
}
}
}
k=OrdersTotal();
for (i=0; i<k; i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==sy || sy=="") {
if (OrderType()<=6) {
if (op<0 || OrderType()==op) {
if (mn<0 || OrderMagicNumber()==mn) {
if (TimeDay (OrderOpenTime())==Day()
&& TimeMonth(OrderOpenTime())==Month()
&& TimeYear (OrderOpenTime())==Year()) return(True);
}
}
}
}
}
}
return(False);
}
Can you tell me what this code means or more precisely how it works in principle? In this case the macro substitution is used, and it is the main condition to open orders. PS. The global variable is not modified anywhere.
Директива #define подставляет expression вместо всех последующих найденных вхождений identifier в исходном тексте. identifier заменяется только в том случае, если он представляет собой отдельный токен. identifier не заменяется, если он является частью комментария, частью строки, или частью другого более длинного идентификатора. expression может...
Can you tell me what this code means or more precisely how it works in principle? In this case the macro substitution is used, and it is the main condition to open orders. PS. The global variable is not modified anywhere.
code needs to be inserted Alt+S
and where is the function ?
how did you compile it ? no errors ?
His code has work with pending orders and the function works with positions - needs a little tweaking
His code works with pending orders, while the function works with positions - we need to make some adjustments
Exactly right, only limit orders sellstop and buystop are handled. What do you need to correct?
Absolutely correct, only sellstop and buystop limit orders are being worked on. What needs to be fixed?
Is this function for buy side or for both buy and sell?
Should I keep the 6 order types highlighted in yellow?
It compiled without errors, but it does not open orders
Is this function for buy side or for both buy and sell?
Should I keep the 6 order types highlighted in yellow?
It compiles correctly but does not open orders
This is for all types. It should work if you use it correctly
P.S. Try to logically analyse why it might not work and what is preventing it from doing so.
And it's probably better to insert the function once, it doesn't matter what type is or has been in the market anyway
Happy New Year Bulls to everybody! Bullish growth to all!)
( High[1] - Low[1] ) / Point()Can you tell me what this code means or more precisely how it works in principle? In this case the macro substitution is used, and it is the main condition to open orders. PS. The global variable is not modified anywhere.
Hello all!
Can you tell me what this code means or more precisely how it works in principle? In this case the macro substitution is used, and it is the main condition to open orders. PS. The global variable is not modified anywhere.
maybe it's
MARKET_WATCH, // окна "Обзор рынка"