Structure rules. Learning how to structure programmes, exploring possibilities, errors, solutions, etc. - page 19

 
komposter:

MetaDriver says it right, and his system is correct. Dick_fx would also add that the "trading driver" should work with 10-20 platforms to use the best prices.

But using such a correct system is convenient only under ideal conditions - no errors in strategy, no user intervention, no force majeure... And in reality this is rarely the case.

Let me give an example of dick_fx: 25 strategies are working, aggregator (trade driver) collects them into a net position and puts them into the market, everything is OK. Suddenly, something goes wrong in 17-th strategy and it gives unhealthy forecasts - it says to open at 50% of the deposit. Expert Advisor opens obediently.

What does a trivial locker a la MT4 do:

  • removes the 17th EA from the chart (it is easy to find it by the magik in the deal),
  • close the corresponding position (in terms of MT4) or part of the position (in terms of MT5),
  • reads logs, created by this EA, to analyze the situation.

Now let's move on to "correct accounting". What should the trader do to correct the error (a 50% margin trade - an obvious logic error)?

  • Find which strategy generated it (how? from the logs?),
  • Find the appropriate code and edit it (return(0)?),
  • OR in the position summing loop, opposite the required strategy (the number should not be mistaken!), put continue;
  • Compile the Expert Advisor (if it is MT4 - first close the terminal, or after compilation, specify the correct settings),
  • The analysis of the situation - a separate song (if not provided with its own logs with division into strategies).

The question is: Which is easier? Obviously, the variant with MT4.

And what is cheaper? Obviously, the option with Netting.

What is the conclusion? To make a market driver with GUI from MT4 ;)

The problem of localization of a glitchy strategy in a crowd of summarized heterogeneous strategies exists but it has not yet become so dramatic. Personally I summarize (in large amount) only homogeneous strategies, for example, differently optimized neural nets. But everything is easier there - the signals of strategies are normalized (-1...+1), each strategy makes a microscopic contribution to the aggregate position, the scheme reliability is achieved due to "statistical preponderance". On the other hand, it is more complicated - it is almost unreal to catch a glitch in such crowd in time. Only by individual testing (preferably by automated testing).

Can try to generate ideas for this localization, but not trying to "reflexively" jump to 4, and just feel the space of options - maybe something better will be found. :)

// Probably, it would be impossible to invent an individual equity indicator (aka tester) for every strategy better, but so far it appears to be too much of a burden.

 
komposter:

MetaDriver says it right, and his system is correct. Dick_fx would also add that the "trading driver" should work with 10-20 platforms to use the best prices.

But using such a correct system is convenient only under ideal conditions - no errors in strategy, no user intervention, no force majeure... And in reality this is rarely the case.

Let me give an example of dick_fx: 25 strategies are working, aggregator (trade driver) collects them into a net position and puts them into the market, everything is OK. Suddenly, something goes wrong in 17-th strategy and it gives unhealthy forecasts - it says to open at 50% of the deposit. The Expert Advisor opens obediently.

What does a trivial locker a la MT4 do:

  • removes the 17th EA from the chart (it is easy to find it by the magik in the deal),
  • close the corresponding position (in terms of MT4) or part of the position (in terms of MT5),
  • reads logs, created by this EA, to analyze the situation.

Now let's move on to "correct accounting". What should the trader do to correct the error (a 50% margin trade - an obvious logic error)?

  • Find which strategy generated it (how? from the logs?),
  • Find the appropriate code and edit it (return(0)?),
  • OR in the position summing loop, opposite the required strategy (the number should not be mistaken!), put continue;
  • Compile the Expert Advisor (if it is MT4 - first close the terminal, or after compilation, specify the correct settings),
  • The analysis of the situation - a separate song (if not provided with its own logs with division into strategies).

The question is: Which is easier? Obviously, the variant with MT4.

And what is cheaper? Obviously, the Netting option.

What is the conclusion? To make a market driver with GUI from MT4 ;)

One gets the feeling that MT5 trades positions.

Netting is an accounting system and not more than that, MT4 has only order history, MT5 has both order history and their summation in a position.

I.e. MT5 unambiguously has more information to process.

We should also keep in mind that each order has a magik and a comment as well as in MT4. They allow us to identify which aggregator strategy has placed an order by 50% of the margin.

If we do not know how to use this kind of magic numbers and comments, we will not see how easy it is to identify the order.

If we want to use an MetaTrader 5 as a data feed, then put an out order in the same order that is supposedly being closed, then in the closed orders will be listed only those orders that have out orders, and in the open orders that do not have out.

 
TheXpert:

The trade driver lowers the reliability of the system.

Don't you really believe that? And you talk so vigorously about the driver as something really cool.

Here's an example -- we have a round robin arbitrageur. The first order triggers by limit, and then the round is closed by market.

What happens in the internal tester? The circle is closed and there are no Requotes, requotes, pings and other things that disturb trading.

Now let's imagine that after the limit requote (the trigger was there, the position did not appear) the price has rolled back and it happened at midnight (the law of Fortune) and the connection was lost for that time.

The signal was detected and there is a position in the internal tester; it should be set. This resulted in a huge loss by arbitrage standards. In fact, the response ended with a rejunction, so it is not necessary to open a position.

The best shoes are those that are custom-made to fit your feet. The more versatile, the less reliable.

 

TheXpert:

TheXpert:

The trade driver reduces the reliability of the system.

Don't you really believe it? And discussing the driver so vigorously as something really cool.

Example - we have a round robin arbitrageur. The first order triggers on the limit, then the circle closes on the market.

What happens in the internal tester? The circle is closed, there are no re-jacks, requotes, pings and other things that disturb trading.

Now let's imagine that after the limit requote (the trigger was there, the position did not appear) the price has moved back but it happened at midnight (the law of Fortune) and the connection was lost for that time.

The signal was detected and there is a position in the internal tester; it should be set. This resulted in a huge loss by arbitrage standards. In fact, the response ended with a rejunction, so it is not necessary to open a position.

The best shoes are those that are custom made to the foot. The more versatile, the less reliable.

Well, well, well.


Happy birthday to you....!

--

Andriyuha, of course this driver is for predicting strategies, not arbitrage strategies. And one does not exclude the other. The place of arbitrage strategies is somewhat further down the channel, namely in the aggregator. I am planning this module (arbitrage). If we continue with the scheme... I wrote about it just yesterday, though, here

https://www.mql5.com/ru/forum/105007/page9#821911

and further here

https://www.mql5.com/ru/forum/105007/page10#821949

 
Urain:

Go from the task. Which tasks are most in demand in the GUI?

You can do it from there. Describe what you're trying to achieve, pick the common features, make the framework, then add some more stuff, see how easy it is to change the framework.

To understand what it should be, rewrite it. That's how it looks to me.

I'd like something like that:

Urain:
What if you make the API reference through the reference module? Then you can change one module and change the platform.

I mean, I'll have to make up a universal (: forgive me TheXpert :) customizable event router. To connect it to TC on one side and GUI on the other one.

--

TheXpert:
...

The best shoes are the ones that are custom made to fit your foot. The more versatile, the less reliable.

// Andrei, the purpose of universal solutions is multiple use. I know the disadvantages myself. ))

 
Urain:

You get the feeling that MT5 trades in positions.

Netting is an accounting system and no more than that, MT4 has only order history, MT5 has both order history and their summation in a position.

I.e. MT5 unambiguously has more information to process.

We should also keep in mind that each order has a magik and a comment as well as in MT4. They allow us to identify which aggregator strategy placed an order by 50% of the margin.

If we do not know how to use this kind of magic numbers and comments, we will not see how easy it is to identify the order.

If we want to use an MetaTrader 5 as a data feed, then put an out order in the same order that is supposedly being closed, then in the closed orders will be listed only those orders that have out orders, and in the open orders that do not have out.

You have practically closed the subject of the advantage of an order system (MT4) over a net order system (MT5). Such a thing hadn't occurred to me, although it obviously works and is nearby.
 
MetaDriver:
I did not think of such a trick, although it clearly works and is nearby.
I think it's strange that it didn't occur to me :) then you need a second hint - in fact, there should be three connected magicians, because there are also TP and SL.
 
sergeev:
Strange that it did not come :) then a second hint for you - in fact, there should be three related magicians, because there are also TP and SL.

Not relevant to me - I do not use trading (strategic) stops, although thanks for the tip. ))

--

Wap all these problems are mostly far-fetched (at netting), or from customers from job. Quaternary form of "diversification of strategies" sticking out from under it, atavism is naked, no better than locomotion. You can write the whole history of both recommended positions and execution (market positions) on disk in general. For each sub-strategy individually. If the writer doesn't waste time, put it in a separate thread (Expert Advisor) and feed it with the information through custom events. For the analysis of "realities of execution" it may well come in handy.

 
Urain:
And if you make an API reference through the reference module? then you can change one module and change the platform.

Exactly. There is no need to write a separate module. Because the data provider is that very module. I will draw the scheme of such an application on Monday. As for GUI, we don't need to make up any "event router", as Vladimir suggests. The runtime module supports GUI interface, which means any TC connected to the runtime module will start working with GUI panel by default, even without knowing anything about it (schematic will be available on Monday). The runtime module here is like an adapter class. The principle is simple:

Any system that knows how to work with the executable can interact with each other, without knowing anything about each other.

 
MetaDriver:
I haven't even thought of such a thing, although it is obviously working and can be found near me.

It's strange, Vladimir, that this has come as a revelation to you. I have been using this scheme in my work for almost a year now.

Yes, understand that it's not about netting. As Vladimir correctly pointed out, algorithms rule, you can't build a big, and most importantly scalable project without knowing how to structure the data correctly. Pay attention to the active discussion of the market driver scheme, one needs this and the other needs that, and within this scheme we have to introduce more and more new modules, interrelations, different "event routers". And what would the project become if dozens or two traders with different tasks and different understanding of the market use it?

For some reason, the words of Alexander Radishchev come to mind: "The monster is mischievously huge, stoic and barking".