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

 
Andrey Miguzov #:

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.

Скачайте Торговую утилиту 'HedgeTerminalUltimate' для MetaTrader 5 в магазине MetaTrader Market
Скачайте Торговую утилиту 'HedgeTerminalUltimate' для MetaTrader 5 в магазине MetaTrader Market
  • www.mql5.com
Торгуйте разнонаправленно вместе с HedgeTerminal HedgeTerminal - это полноценный торговый терминал внутри самого торгового терминала MetaTrader 5. Это
 
Pavel Malyshko #:

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.

 
tapo #:

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...

tapo #:

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.

Vasiliy Sokolov #:

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....

 
Andrey Miguzov #:

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.

 
Vasiliy Sokolov #:

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.

 
Embedded base has its advantages: native support, it's easier to deploy a shopping complex on a vps. Local is also a plus for small tasks. In fact, just work with a local file. Ease of use. Large full-fledged bases certainly also have a place, but probably for something more complex. Plus you have to write your own driver for mql. This is another pleasure.
 
Vasiliy Sokolov on a vps. Local is also a plus for small tasks. In fact, just work with a local file. Ease of use. Large full-fledged bases certainly also have a place, but probably for something more complex. Plus you have to write your own driver for mql. This is another pleasure.

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.

 
Vasiliy Sokolov #:

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....

Your example has a place, of course, but in that case we represent two different things. I'm talking about wide spread, extremely low liquidity. Where many seconds or even minutes have to pass for the situation you described to occur. In your situation, I think marques are the best solution.


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.

 
JRandomTrader #:

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.