I am opening a project to test a strategy for working with pending stop orders.
The essence of trade: at start we put two stop pending orders (Buy stop and Sell stop). If one triggered, then delete the second (we will simply modify it later, but for now, simply delete it) and again two stop pending orders.
The meaning: a set of positions by trend.
Picture:
(a little later ...).
How to access the full code: ONLY through connection to the project, while the pieces will of course be in discussion in this thread. The Expert Advisor itself will be in the form of a class (*.mqh).
I am currently doing something similar to order, only more complicated
I will follow the project with interest...
I will follow the project with interest...
Please clarify, do you want to be connected to the project(Projects - MetaEditor) ?
- www.metatrader5.com
Hi!
The main objectives are described above:
- is to create an EA as a separate class
- development of projects(Projects - MetaEditor)
- testing a trading strategy on stop pending orders
- www.metatrader5.com
I find the topic interesting. First of all, the condition "as a class".
My "purely as a class" didn't work. The system architecture includes the Main Template, which contains standard functions OnInit(), OnTick(), etc. Also, the object of CExpert class is declared in it - it has functions - class members, which are handlers of all these events. In the Main template - the member functions are called from standard functions.
So, we already have "not purely in the form of a class", because there are standard functions, from which the event handlers of the EA class are called.
And in this architecture, if we want to replace this very EA class, we will have to rewrite this entire template file. The EA as a class" should look like this: we declare an EA class (all its description is in the include files), include a template - and that's it.
In other words, it turns out that in the template, there should be standard functions, a hub object that connects the EA to these standard functions, and then the main file can be reduced to "correct structure" - declaring an EA object and connecting the template. In this case, in the main file, we declare an EA object, connect the main template, the hub object registers an object and connects its handler functions in the main template to the standard event functions.
It is even possible to implement a lot of TC in one EA - for this, several EA objects are declared and the Hub class connects them all to main functions, and they work independently of each other (of course, when connecting, one must check the difference in magicians, and the EAs themselves must select positions of their magicians).
About "connect me to the project" - I'm ready to connect in Read Only mode - I'm unlikely to write anything, but I can look, suggest something, point out errors.
***
And further, in this architecture, if we want to replace this very class-advisor, we will have to rewrite this entire template file. The "EA as a class" should look like this: we declare an EA class (all its description - in include files), connect the template - and that's it.
***
... connect the template and pass the input parameters to the Expert Advisor class
***
About "connect me to the project" - ready to connect in Read Only mode - it is unlikely I will write something, but to look, to offer something, to point out errors - I can.
Done, connected.
... connect the template and pass the input parameters to the EA class
Done, plugged in.
О ! I have it. I have the files. When I have time, I'll see what's there.
Who can't program, can't participate?
Anyone can participate, but only those who want to join the project(Projects - MetaEditor) will have access to the FULL code. There will be a discussion of the project, so the opinion of anyone (programmer or user) will be valuable.
- www.metatrader5.com
I don't know how to program, but I built your idea for 4.
There is only mql5 here. The old terminal does not quote.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm opening a project
To test a strategy for working with pending stop orders.
The essence of trade: at start we put two stop pending orders (Buy stop and Sell stop). If one triggered, then delete the second (we will just modify it later, but for now, simply delete it) and again two stop pending orders.
The meaning: a set of positions in accordance with the trend.
Screenshot (result when there is a trend and several pending orders have triggered):
(a little later ...).
How to access the full code: ONLY through connection to the project, while the pieces will of course be in discussion in this thread. The EA itself will be in the form of a class (*.mqh).
Added:
When the EA is running, data is written to an array in OnTradeTransaction. The format of recording is as follows: if we have a Buy position, we record '+1'; if we have a Sell position, we record '-1'.
Let's check the idea of pyramiding (in case a position was opened in the direction of the previous one)