Discussion of article "How to Secure Your Expert Advisor While Trading on the Moscow Exchange" - page 6

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
SZY:
To realise correct trading on one account by different experts on the same instruments (you have written about this topic in other threads) it took more time than to write and test the main strategy :). And I am not sure that everything works correctly yet.
Huh... I know. From necro-development: https: //www.mql5.com/ru/market/product/5011?source=Site+Market+Product+Page#description 2013 by the way. Now it is lying on github nobody needs it. In general, the idea was interesting, although wrong. Now I have made a drive based on the system of counting votes in the form of lots. It works easier and more reliable. It gives in general more pluses. On the downside, it is impossible to view the statistics of each strategy separately on the real.
What's wrong with that? the very technology of limit orders obliges the broker to execute at the best price if he has a central bank licence. what's wrong with that?
It's obvious you're from the forex world. A broker's limit order does not obligate him to execute it. A counterparty, specifically a price-taker, who hits the market, and not necessarily with a market order, executes the limit order. In this case, the price-takers must want to buy when you sell and sell when you buy. If you chase the price, wanting to go with it in one direction, then your limiter is of no use to anybody and will be far behind very quickly.
Hm. Very interesting, how, in the presence of a spread, can a limit be worse than a market entry? And if market entry satisfies the profit threshold, (-commission) then why the need for a limit?
In the moment, you're right. But the example is simple - you need to buy at 1000. There is a limit - the market went in your direction and you were sold at 1000. And the price became in 50 ms - 900 :) Is buying at 900 better than buying at 1000?
The limit price is in the spread and from TC's point of view - 1000 is a great price. But 900 is even better...
How did you implement it? Not through global variables of the terminal?
All according to the precepts of my colleagues (thank them very much) - I write data about the last position to the file :) When starting the Expert Advisor, if there are discrepancies with the file - I dig into the history of the position (by trades to the identifier and magik). If there is no position at the moment - I pick through the history of deals (by magik).
As far as I understand, this is not the only way, but it is the clearest to me.
On the downside, it is impossible to view the statistics of each strategy separately on the real.
Man, I haven't thought about it yet....
All according to the precepts of my colleagues (thank them very much) - I write data about the last position into the file :) When starting the Expert Advisor, if there are discrepancies with the file - I pick through the history of the position (by deals to the identifier and magik). If there is no position at the moment - I pick through the history of deals (by magik).
As far as I understand, this is not the only way, but it makes the most sense to me.
Man, I have not thought about it yet....
You're wrong about the file. Try to use a base instead of a file. We really actively used files in the last decade, when there was no native ability to work with a database. Now all these cases are obsolete.
You're wrong about the file. Try to use a database instead of a file. We really actively used files in the last decade, when there was no native ability to work with a database. Now all these cases are obsolete.
About the database - in principle, interesting. But not SQLite, but PostgreSQL or MySQL.
Built-in - if it is small.
And if there are 10000 robots (including test robots) and each of them stores positions, orders, statistics, current stop level, etc., it can hardly cope. - it can hardly cope.
You're wrong about the file. Try to use a database instead of a file. We really actively used files in the last decade, when there was no native ability to work with a database. Now all these cases are obsolete.
I don't like the file too much, but in fact it is needed only for memorising the extreme point from which the database of deals in the account history is searched (so that you don't have to dig through the whole history). As soon as I get my hands on it, I will redo it, I just haven't worked with bases through MQL - I need to understand it.
Forum on trading, automated trading systems and testing trading strategies
Discussion of the article "How to protect yourself and your Expert Advisor when trading on the Moscow Exchange"
Andrey Miguzov, 2022.06.29 12:24 AM
In the moment - you are right. And so the example is simple - you need to buy for 1000. There is a limit - the market went in your direction and you were sold at 1000. And the price became in 50 ms - 900 :) Is buying at 900 better than buying at 1000?
The limit price is in the spread and from TC's point of view - 1000 is a great price. But 900 is even better...
All according to my colleagues' precepts (thank them very much) - I write the data on the last position in the file:) When starting the Expert Advisor, if there are discrepancies with the file, I dig into the history of the position (by deals to the identifier and magik). If there is no position at the moment - I dig in the history of deals (by magik).
As far as I understand - this is not the only way, but it is the clearest to me.
Man, I haven't thought about it yet....
IMHO, not the best solution. If finam (it varies from broker to broker), then, in my opinion, it provides everything necessary for on-the-fly calculation (parsing of history trades). But this way you have to check the file additionally, and it is not clear why it is necessary. GlobalVariableSetOnCondition() to prevent several Expert Advisors from entering at the same time.
Built-in - if it's small.
But if there are 10000 robots (including test robots) and each of them stores positions, orders, statistics, current stop level, etc., it can hardly cope. - it can hardly cope.
If you really have such a large number of robots and not a hypothetical example, I recommend switching to a consensus/voting system. With such a large number of systems it will be an order of magnitude easier to work with.