I have been trading manually, eurusd 5 min, check it if you have time....
i want to build an EA based on this strategy, i just need to close trades with condition _2 :),i can't figure it out, i even have a close function and i get errors all the time.....
int start()
{
}
//+----------------------------------------------------------------------------+//| Автор : Ким Игорь В. aka KimIV, http://www.kimiv.ru |//+----------------------------------------------------------------------------+//| Версия : 13.06.2007 |//| Описание : Удаление ордеров. Версия функции для тестов на истории. |//+----------------------------------------------------------------------------+//| Параметры: |//| sy - наименование инструмента (NULL - текущий символ) |//| op - операция ( -1 - любой ордер) |//| mn - MagicNumber ( -1 - любой магик) |//+----------------------------------------------------------------------------+void DeleteOrders(string sy="", int op=-1, int mn=-1) {
int i, k=OrdersTotal(), ot;
if (sy=="" || sy=="0") sy=Symbol();
for (i=0; i<k; i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
ot=OrderType();
if (ot==OP_BUYLIMIT || ot==OP_BUYSTOP || ot==OP_SELLLIMIT || ot==OP_SELLSTOP) {
if (OrderSymbol()==sy && (op<0 || ot==op)) {
if (mn<0 || OrderMagicNumber()==mn) {
OrderDelete(OrderTicket(), CLR_NONE);
}
}
}
}
}
}
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.
copied the code from here and created a new project (EA) pasted the code -> compiled
Strangely enough, it still gives the same errors...
I have been trading manually, eurusd 5 min, check it if you have time....
i want to build an EA based on this strategy, i just need to close trades with condition _2 :),i can't figure it out, i even have a close function and i get errors all the time.....
created again, deleted everything, but left the function and saved it - but no errors
but as soon as I add int start there are errors... What could be the problem?
does not work...
how then to close an order with this function under condition_2 close an order
here is the condition to open a trade in condition_1