Discussion of article "Library for easy and quick development of MetaTrader programs (part IV): Trading events" - page 2

 
BmC:

Artem, first of all. first of all. I would like to say thank you very much for the series of articles and the library. I have understood everything about OOP by reading your articles! Your articles really teach and help those who need it, they helped me. Your use of different algorithms in the same places where you could just repeat yourself is also very successful.

Now if I may get to the point: ::GetListByTime - in this method you select orders by time interval to pass the list to the calling programme, in Part 3 you write that:

...

Thanks for the feedback.

You should definitely call the Sort() method before each search for a property. Sort methods are specified in the lists of possible criteria for sorting objects in Defines.mqh. And they must be specified when calling the Sort() method in case you need to sort by one of several sorting types. In the class constructor, just the default sorting type is set, but when searching for a property, this property must be specified in the Sort(THIS_THERE_NEW_SORTING_THYPE_SORTING) method - so that the list will be sorted exactly by the specified property.

PS. The code is inserted using Alt+S in the message editor:


 
Artyom Trishkin:

Thanks for the feedback.

The Sort() method must be called before each search for a property. Sorting methods are specified in the lists of possible criteria for sorting objects in Defines.mqh. And they must be specified when calling the Sort() method in case you need to sort by one of several sorting types. In the class constructor, just the default sorting type is set, but when searching for a property, this property must be specified in the Sort(THIS_THERE_NEW_SORTING_THYPE) method - so that the list will be sorted exactly by the specified property.

PS. The code is inserted using Alt+S in the message editor:


THANK YOU.

You have realised that I took a lot of pains to transpose the code.)))))

 
BmC:

THANK YOU.

You have realised that I took great pains to transfer the code.)))))

Yes :)

 

Hello God!

Can you please tell me: how does EA find the biggest loss out of a total of 88 orders in a multi-species order list. That is, the order with the smallest profit. And return the order number? I'm looking forward to your advice! Thank you! WeChat.QQ: 1041327590. mobile phone: 13276899818

 
wts130196910 :

Hello God!

Can you please tell me: how does EA find out the biggest loss out of a total of 88 orders in a multi-species order list. That is, the order with the smallest profit. And return the order number? I'm looking forward to your advice! Thank you! WeChat.QQ: 1041327590. mobile phone: 13276899818

How are you trying to do this yourself with a library? Please show your code.

Как вы сами это пытаетесь сделать с помощью библиотеки? Покажите ваш код пожалуйста.

 
It seems that when adjusting the price of a stop order (BUY STOP) in connection with StopLevel, it also recalculates SL/TP and sets them to the minimum distance.... For Buy Stop at the current price, which does not satisfy StopLevel, having recalculated the price of the order, it recalculated SL to the same distance as from the initial request..... That is, the buy stop price level was set higher and the SL level was set higher. Is it possible to somehow switch on the mode that corrects the opening price, but does not touch the original stops. Only touch the stops if their initial value does not satisfy StopLimit/Freezelevel.
 
puts them at a minimum distance
not at a minimum distance, but at the distance of the original order.
 
leonerd:
It seems that when adjusting the price of a stop order (BUY STOP) in connection with StopLevel, it also recalculates SL/TP and sets them to the minimum distance.... For Buy Stop at the current price, which does not satisfy StopLevel, having recalculated the price of the order, it recalculated SL to the same distance as from the initial request..... That is, the buy stop price level was set higher and the SL level was set higher. Is it possible to somehow switch on the mode that corrects the opening price, but does not touch the original stops. Only touch the stops if their initial value does not satisfy StopLimit/Freezelevel.
The library tries to set the order and its stop levels. It is better to monitor stop levels and adjust them after it is successfully set. Because there are many different needs, and it is impossible to take them all into account. As well as the setting level can be adjusted later.
 
Artyom Trishkin:
The library tries to place the order and its stop levels. It is better to monitor the stop levels and adjust them after it is successfully set. Because there are many different needs, and it is impossible to take them all into account. As well as the setting level can be adjusted later.

Yes, I see. It would be good to add an adjustment flag. So that the flag could be set to correct in connection with StopLevel or not. I don't want to change the code, then everything will be lost when updating. Thanks.

 
leonerd:

yes, I see. It would be good to add an adjustment flag. So that the flag could be set to correct in connection with StopLevel or not. I don't want to change the code, then everything will be lost when updating. Thank you.

You should write the logic in your programme, not change the library code. However, I will think about the proposal. But I can hardly come back to it quickly to make it.