Questions from Beginners MQL5 MT5 MetaTrader 5 - page 59

 
A100:
In some platforms it is possible to bind 1 (sometimes 2) CCA orders. In MT4/5 I programmatically implement a chain of linked orders (sometimes quite complex) and find this a more convenient option
Than execution on a server, for example?
 
Silent:
Than server execution, for example?

There is less flexibility and not necessarily more reliability in server execution

There is no alternative to server execution only between quote time and trading time

 
A100:

There is no alternative to server execution only between quote time and trading time

...and when your internet is down.

Now of course it's not hard (not expensive) to provide a stable PC, but still client side solutions cannot compete with server based execution.

My understanding is that brokers don't want to take responsibility for execution and MKs support them.

 
Yedelkin:

So the question comes down to how exactly to delete a pending order that is not an SL or TP order when certain events occur (in particular, when a TP order triggers at an open position).

At present, such a pending order can only be deleted compulsorily by sending the relevant "Delete Pending Order" request. So we have to monitor on the terminal side the occurrence of certain events and send a request. But unlike your variant, there are only two fields to be specified in the request, one of which is request.order.

In the situation you mention, OCO orders ("One Cansels Other(s)") would be helpful: on the TP level, an order would be placed with a volume equal to the open position, on the SL level, an order with the volume needed to "reverse" the position would be placed. If one of these OCO orders triggered, the second one would be automatically removed on the server side. However in the course of the existence of this forum, the platform developers have flatly refused to implement any additional order types, including OCO orders.

Thanks for the recommendations. In my case decided that the easiest thing to do was to use the order expiry time, ie:

.........
request.type_time =ORDER_TIME_DAY; 
........
It is not clear how to set a time limit of 2 days ?
 
Crucian:
It is not clear how to set a 2 day expiry time ?

datetimeexpiration;

Add 2 days or 60*60*24*2 seconds to the current date

 
komposter: ...and when your internet is down. ... client-side solutions cannot compete with server-side execution.
Don't take away your colleague's illusions :)
 
Crucian: In my case decided that the easiest thing to do was to use the expiry date of the order... It is not clear how to set the expiry date to 2 days ?
request.type_time =ORDER_TIME_SPECIFIED;     // есть ещё ORDER_TIME_SPECIFIED_DAY - там, наверное, всё по аналогии
request.expiration=TimeTradeServer()+172800; // 172800 - количество секунд за период в два дня, TimeTradeServer() - момент оформления запроса
 

How can the tester chart, after testing, display text above the trades? Or in general, how to make the tester's chart display some additional objects after testing?

I tried to insert them in the OnDeinit() function, but nothing is displayed.

 
ANG3110:

How can I display the text above the trades on the tester chart after testing? Or in general, how to make the tester's chart display some additional objects after testing?

I tried to insert them in the OnDeinit() function, but nothing is displayed.

Once the test is completed, go to the Results tab, right-click and select Open Chart from the context menu. A chart with all trades will open and you can create any objects on it and apply any indicators for analysis.
 

tol64:
После того, как тест завершён перейдите на вкладку Результаты, нажмите правую кнопку и в контекстном меню выберите Открыть график. Откроется график со всеми сделками и на нём можно создавать любые объекты и применять для анализа любые индикаторы.

This is a bit of a pain in the ass, in my MT4 after the test both profit of one trade and balance and if necessary other things were signed on the output chart at once. All this was done simply by inserting additional include in deinit() of the EA. Is it possible to output something as text through OnDeinit in MT5? Or it is disabled here too and it is just another cheat for convenience of developers to the detriment of a user?
Reason: