Discussion of article "Library for easy and quick development of MetaTrader programs (part VIII): Order and position modification events" - page 2

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
Artem, thanks again!
The method"void CEventsCollection::CreateNewEvent(COrderControl* order)" is used to create a trade event depending on the type of order change, i.e. it creates an event associated with any order change.....
And the reason of order change is sent to the created event is the same: EVENT_REASON_STOPLIMIT_TRIGGERED.
If I am right please correct it, if not please explain what I did not see.
Thank you very much for the library you have simplified my labour in several times,
especially when the main work is not connected with programming.
Artem, thanks again!
The method"void CEventsCollection::CreateNewEvent(COrderControl* order)" is used to create a trade event depending on the type of order change, i.e. it creates an event associated with any order change.....
And the reason of order change is sent to the created event is the same: EVENT_REASON_STOPLIMIT_TRIGGERED.
If I am right please correct it, if not please explain what I didn't see.
Thank you very much for the library you have simplified my labour in several times,
especially when the main work is not connected with programming.
Without linking to the exact location of the quoted lines, I can't understand what exactly you are talking about - just by searching (Shift+Ctrl+F) I couldn't find such code in all the library files...
event.SetProperty(EVENT_PROP_REASON_EVENT,EVENT_REASON_STOPLIMIT_TRIGGERED);
Where is it located?
Without linking to the exact location of the quoted lines, I can't understand what exactly you are talking about - just by searching (Shift+Ctrl+F) I couldn't find such code in all the library files...
Where is it located?
Here are the lines from the description in the very part of this article and the code at the end of the article: underline this line!
At the moment - in the current version of the library, the method looks like this:
So, either it was a bug and it has been fixed long ago, or it is not critical in the discussed version of the library. I don't remember exactly how it was....
At the moment - in the current version of the library, the method looks like this:
So, either it was a bug and it has been fixed long ago, or it is not critical in the discussed version of the library. I don't remember exactly how it was...
This is very important, from the author it's even more important. If you have not abandoned your original idea. To help novice programmers like me with my work. When you are a beginner (a student) and you are just learning a programming language, or programming in general, there are a lot of doubts and questions when studying your work (library). In this case I wasn't sure until the last moment whether it was a mistake or your intention. I went through your code more than once. And for me it is very important: "either I didn't understand the author's meaning, or it is just a typo of the author in his big project."
And how do you say that it is not critical?! This is wrong on your part, thereby you and I are just confusing the readers. Who study or learn as I do, from your library.
This is very important, from the author it's even more important. If you haven't given up on your original idea. To help novice programmers like me with my work. When you are a beginner (a student) and you are just learning a programming language, or programming in general, there are a lot of doubts and questions when studying your work (library). In this case I wasn't sure until the last moment whether it was a mistake or your intention. I went through your code more than once. And for me it is very important: "either I didn't understand the author's meaning, or it's just a typo of the author in his big project."
And how do you say that it's not critical?! This is wrong on your part, thereby you and I are just confusing the readers. Who study or learn as I do, from your library.
:)
I showed you the code with the corrections highlighted in colour. Put them in the version of the library attached to this article.
Of course, I don't remember whether it was my mistake or it is not critical in this version and therefore it passed by my eyes during debugging. After all, it's already forty-odd articles, and this one was so long ago. Most likely it was a bug, which was corrected in subsequent articles - a lot of things in the library are already created on the fly. Of course there was, and more than one, test versions of the library. But since the beginning of the description of its creation much has been revised and added. That's why this series of articles is positioned as a description of the creation of the library. In this way I try to involve the reader in the process of its creation. With trials and errors, and with instructions on how to fix them - to make the whole process visible - to reveal, so to speak, "all the pains of creation" :) :)
So, I apologise for any confusion in your understanding of what is going on.....
Just make the changes suggested above. Or leave it until the article where it will be corrected.
I want to get the last event symbol, ticket and type (open, close, modification), how to do it correctly?
I see Artyom is so busy that he doesn't appear on the forum at all.)))))))) Maybe I can give you a hint, once I experimented with his library. Today I went through those experiments and found such a function. The comment says that the function gets a list of all open positions.
Unfortunately, I can't explain what it's for, I've forgotten everything, but maybe you can figure it out....
Well... if you can't, wait. Artem will find time and reply.
When a tick is received, on which a pending order is set and simultaneously activated (triggered) (I tested with Buy Stop), your engine does not register all events...
The TRADE_EVENT_PENDING_ORDER_PLASED event is received, but not TRADE_EVENT_PENDING_ORDER_ACTIVATED.
My code is something like this:
I first find the index of the old (processed) event in the loop, and then starting from it, I loop through all the new ones until the end. So, in a situation where on one tick a limit order is set and striggeren receives one event about setting... Please comment.
I call ProcessTradeEvents() in OnTick() following engine.OnTick(rates_data).