Here is the situation: I had a pending order of type 5(Sell Stop) and then the price reached it and it became a market order. Has the order type changed? I.e. has 5 changed in its properties?
When I insert the above mentioned combination, the "Actions" still change the characteristics of the open order but they should not. That is why I would like to make it a condition so that the actions are applied only to pending orders.
if(OrdersTotal()) // Если стоят ордера в списке
{
OrderSelect(0, SELECT_BY_POS); // Выбираем первыйif(OrderType()==(2||3||4||5)) // Если он не открытый то можем модифицировать
{
Alert("Что то делаю с ордером =)");
if (PricePointNew>PricePointOld)
OrderModify( Ticket, PricePointNew-5*0.0001, PriсeStopNew+8*0.0001 , PricePointNew-Profit*0.0001 ,0 ,Green);
elsePrint("OrderModify 1 вернул ошибку - ",GetLastError());
if (PricePointNew<PricePointOld)
OrderModify( Ticket, PricePointNew-5*0.0001, PriсeStopNew+8*0.0001 , PricePointNew-Profit*0.0001 ,0 ,Green);
elsePrint("OrderModify 2 вернул ошибку - ",GetLastError());
if(PriсeStopNew>PriсeStopOld && (PriсeStopNew-PriсeStopNew)<(Stop*0.0001))
OrderModify( Ticket, PricePointNew-5*0.0001, PriсeStopNew+8*0.0001 , PricePointNew-Profit*0.0001 ,0 ,Green);
elsePrint("OrderModify 3 вернул ошибку - ",GetLastError());
if(PriсeStopNew<PriсeStopOld)
OrderModify( Ticket, PricePointNew-5*0.0001, PriсeStopNew+8*0.0001 , PricePointNew-Profit*0.0001 ,0 ,Green);
elsePrint("OrderModify 4 вернул ошибку - ",GetLastError());
}
}
else// Если нет ордеров, то ставим
{
f = OrderSend(Symbol(), 5, 0.01,(PricePointNew-5*Point*10) , 1,(PriсeStopNew+8*Point*10) ,(PricePointNew-Profit*Point*10));
OrderSelect( 0, SELECT_BY_POS);
Ticket = OrderTicket();
Then I'm stuck)) When I run Expert Advisor in the tester with visualization, the market order still changes, I don't understand why... I made a big code, apparently there is an algorithmic error somewhere.
Catrock>>: Тогда я застрял)) Запускаю эксперт в тестере с визуализацией, рыночный ордер все равно меняется, непонятно почему.. Нагородил большой код, видимо ошибка где то алгоритмическая.
what exactly is changing in the market order? Be clearer about what you want to achieve.
In a market order at this point, the take profit and stop loss levels change. They should not.
Only pending orders can be changed in my system. If the order becomes a market order, the changes are not allowed. The Expert Advisor uses one order in total.
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.
Скажите пожалуйста, как реализовать условие.-
If( есть отложенные ордера) то делаем то и то ;
Thank you) But it did not solve the situation.
Here is the situation: I had a pending order of type 5(Sell Stop) and then the price reached it and it became a market order. Has the order type changed? I.e. has 5 changed in its properties?
When I insert the above mentioned combination, the "Actions" still change the characteristics of the open order but they should not. That is why I would like to make it a condition so that the actions are applied only to pending orders.
Can't figure it out.
I put the time in the array, but the printer prints 0 =(
Print outputs zeros... What's wrong?Не могу понять
Загоняю в массив время, а принтом выводится 0 =(
Принт выводит нули... Что не так?the array must be declared outside the loop and the size must be fixed (or an indication that it is an indicator array)
Тогда я застрял)) Запускаю эксперт в тестере с визуализацией, рыночный ордер все равно меняется, непонятно почему.. Нагородил большой код, видимо ошибка где то алгоритмическая.
массив надо объявлять вне цикла и размер должен быть фиксированный(либо указание что речь о индикаторном массиве)
всё равно не работает.... как iTime записывает время в массив? В секундах о 1970 или "yyyy:mm:dd hh:mm"
In a market order at this point, the take profit and stop loss levels change. They should not.
Only pending orders can be changed in my system. If the order becomes a market order, the changes are not allowed. The Expert Advisor uses one order in total.