Discussion of article "Library for easy and quick development of MetaTrader programs (part XXI): Trading classes - Base cross-platform trading object" - page 3
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If you need to compare a trade request and a position, then the easiest way is to set the position identifier (not magic). Each request has its own identifier. The magic of the advisor can be left one for all positions. Then by the identifier (it is written in the magic of a position or order and will never be lost), you can accurately match the request and position/order at any time.
Is it something like this?
Trade Request:
Event Handler:
Problem: the CEvent::GetPendReqID() method I need above is protected!! Any better ideas without me having to changw the DoEasy source code? In my humble opinion, these methods should be public ;-)
Problem: the CEvent::GetPendReqID() method I need above is protected !! Any better ideas without me having to changw the DoEasy source code? In my humble opinion, these methods should be public ;-)
You need to watch the CEngine class - only it gives access to the library to user programs.
All other classes are for the needs of the library, and are not intended for users, with the exception of the library service functions that are available in the program after connecting the library to it.
You need to watch the CEngine class - only it gives access to the library to user programs.
All other classes are for the needs of the library, and are not intended for users, with the exception of the library service functions that are available in the program after connecting the library to it.
Can you please give me an example? I am looking at CEngine class and see that it is possible to extract a list of events, check their type etc... so I can access each event but don't find any obvious way to read specific event details packed in the magic number (groups & request ID) from the CEngine object -- as I see it, I still need to read this information directly from the CEvent object instances as in my event handler example above in my robot's even-handler method, i.e. CEvent:GetPendReq()
class CEngine { //... //... //--- Return (1) the list of order, deal and position events, (2) base trading event object by index and the (3) number of new trading events CArrayObj *GetListAllOrdersEvents(void) { return this.m_events.GetList(); } CEventBaseObj *GetTradeEventByIndex(const int index) { return this.m_events.GetTradeEventByIndex(index); } int GetTradeEventsTotal(void) const { return this.m_events.GetTradeEventsTotal(); } //--- Reset the last trading event void ResetLastTradeEvent(void) { this.m_events.ResetLastTradeEvent(); } //--- Return the (1) last trading event, (2) the last event in the account properties and (3) the last event in symbol properties ENUM_TRADE_EVENT LastTradeEvent(void) const { return this.m_last_trade_event; } int LastAccountEvent(void) const { return this.m_last_account_event; } int LastSymbolsEvent(void) const { return this.m_last_symbol_event; } //--- Return the (1) hedge account, (2) working in the tester, (3) account event, (4) symbol event and (5) trading event flag bool IsHedge(void) const { return this.m_is_hedge; } bool IsTester(void) const { return this.m_is_tester; } bool IsAccountsEvent(void) const { return this.m_accounts.IsEvent(); } bool IsSymbolsEvent(void) const { return this.m_symbols.IsEvent(); } bool IsTradeEvent(void) const { return this.m_events.IsEvent(); } //... //... };Не могли бы вы привести мне пример? Я смотрю на класс CEngine и вижу, что можно извлечь список событий, проверить их тип и т. Д., Поэтому я могу получить доступ к каждому событию, но не нахожу очевидного способа прочитать конкретные детали события, упакованные в магическое число (группы и идентификатор запроса) из объекта CEngine - как я вижу, мне все еще нужно читать эту информацию непосредственно из экземпляров объекта CEvent, как в моем примере обработчика событий выше в методе обработчика четных событий моего робота, то есть CEvent :: GetPendReqID ()
Wait a little, please. The next article in the ru-segment will be about advisors, and there I will try to explain.
Wait a little, please. The next article in the ru-segment will be about advisors, and there I will try to explain.
OK, cool - thank you...