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

 

И? The article here is rubbish, the article there is more or less adequate. Shalyto is a smokescreen because his last name is the last one.

Good thing he didn't say it in English, he would have been pecked at.

 
C-4:
That is, you get a robot in a robot. Suppose there is a medium-term algorithm that gives an order to buy at the market. Another, low-level robot executes that order at the best price using the HFT best move technique.

Yes, exactly like that.

Not a robot within a robot, more like a conveyor belt of robots.

 

Better check out my idea:

In finite state machine theory, the number of states is unlimited and can grow like a snowball. What if we assume that there are always only four states, but they are all parallel, i.e. they are called simultaneously from a common module. Two of these states describe all rules for buying and selling. Thus, the robot is sort of in the buying mode and selling mode at the same time. Both of these states are independent of each other. These four states can be described by four functions:

  • Buy signal search mode
  • Mode of searching for a signal to close an existing Buy position
  • Mode of signal search to sell
  • Signal searchmode for closing anexisting sale

This is how a moving averages robot would be described using this logic

1. Long position (Feature): When the fast moving average crosses the slow moving average from bottom to top, we open a long position.

2. Close Long: If the fast moving average has crossed the slow moving average from above downwards - close buy

3. Mode (function) to open short trade: If the fast moving average crossed the slow moving average from above downwards - open sell

4. Short close mode (function): If fast moving average crosses slow moving average from bottom to top - close sell

Please note functions 1 and 4 and 2 and 3. Their conditions are the same! It would seem to be redundant, but it is not true, because the conditions for closing a long position are in no way related to the conditions for opening a short position. If we suddenly decide to add an additional filter for opening a short position, it will not affect conditions of opening a long position, and vice versa. If during the operation of our EA, we want to prohibit selling altogether, we simply stop calling function #3. All short positions that were opened earlier will be closed, sooner or later, upon the signal described in function 4. Long trades will not suffer, because their conditions are independent!

 
C-4:

Better check out my idea:

In finite state machine theory, the number of states is unlimited and can grow like a snowball. What if we assume that there are always only four states, but they are all parallel, i.e. they are called simultaneously from a common module. Two of these states describe all rules for buying and selling. Thus, the robot is sort of in the buying mode and selling mode at the same time. Both of these states are independent of each other. These four states can be described by four functions:

  • Buy signal search mode
  • Mode of searching for a signal to close an existing Buy position
  • Mode of signal search to sell
  • Signal searchmode for closing anexisting sale

This is how a moving averages robot would be described using this logic

1. Long position (Feature): When the fast moving average crosses the slow moving average from bottom to top, we open a long position.

2. Close Long: If the fast moving average has crossed the slow moving average from the top downwards - close buy

3. Mode (function) to open short trade: If the fast moving average crossed the slow moving average from above downwards - open sell

4. Short close mode (function): If fast moving average crosses slow moving average from bottom to top - close sell

Please note functions 1 and 4 and 2 and 3. Their conditions are the same! It would seem to be redundant, but it is not true, because the conditions for closing a long position are in no way related to the conditions for opening a short position. If we suddenly decide to add an additional filter for opening a short position, it will not affect conditions of opening a long position, and vice versa. If during the operation of our EA, we want to prohibit selling altogether, we simply stop calling function #3. All short positions that were opened earlier will be closed, sooner or later, upon the signal described in function 4. Long trades will not suffer, because their conditions are independent!

ns utybq? ,tp gbpls!
 
dfc bp lfcn&
 
C-4:
dfc bp lfcn&
dc` yjhvekm? yt ccs
 
C-4:

Better check out my idea:

In finite state machine theory, the number of states is unlimited and can grow like a snowball. What if we assume that there are always only four states, but they are all parallel, i.e. they are called simultaneously from a common module. Two of these states describe all rules for buying and selling. Thus, the robot is sort of in the buying mode and selling mode at the same time. Both of these states are independent of each other. These four states can be described by four functions:

  • Buy signal search mode
  • Mode of searching for a signal to close an existing Buy position
  • Mode of signal search to sell
  • Signal searchmode for closing anexisting sale

This is how a moving averages robot would be described using this logic

1. Long position (Feature): When the fast moving average crosses the slow moving average from bottom to top, we open a long position.

2. Close Long: If the fast moving average has crossed the slow moving average from above downwards - close buy

3. Mode (function) to open short trade: If the fast moving average crossed the slow moving average from above downwards - open sell

4. Short close mode (function): If fast moving average crosses slow moving average from bottom to top - close sell

Please note functions 1 and 4 and 2 and 3. Their conditions are the same! It would seem to be redundant, but it is not true, because the conditions for closing a long position are in no way related to the conditions for opening a short position. If we suddenly decide to add an additional filter for opening a short position, it will not affect conditions of opening a long position, and vice versa. If during the operation of our EA, we want to prohibit selling altogether, we simply stop calling function #3. All short positions that were opened earlier will be closed, sooner or later, upon the signal described in function 4. The long deals will not suffer, because their conditions are independent!

I have it much easier.

The strategy gives a signal in the form of a recommended position on an instrument. If I want to prohibit selling, I simply cut off the negative values of the aggregate recommended position before sending it to the driver-synchronizer. One line:

if (ShortDisabled) Pos = (Pos<0) ? 0 : Pos;

That's it.

--

My point is that you've described a nice solution to a problem I don't have.

I do not have a problem with distinguishing between buy conditions / sell conditions. It should not exist at the strategy level. The task of the strategy is to predict whether the market will rise or fall in the next moment, and with what probability. This determines the recommended market position. What was there in the past, whether there are open (in either direction) positions now or not - it absolutely does not matter. If one does not get into it - one can solve non-existent problems for half a lifetime. Sometimes even solve them very nicely.

 
And speaking of pulling back to a four (which looks like it's coming), I don't need all those clusters of orders. I've been netting all the way, even before the five came along... :))))
 
MetaDriver:
As for the 4 pullback (which seems to be coming soon), I don't need all those clusters of orders. I've been netting all the way, even before the five... :))))

Forum on trading, automated trading systems and testing trading strategies

Do I need OCO orders?

hrenfx, 2012.01.06 07:46

Can I use MT4 to work in the MARKET? Yes, you can.
Can I use MT5 to run in the MARKET? Yes, you can.

But what is more comfortable and reliable? Not by theoretical reasoning, but by practical analysis.

More convenient than MT4. Yes, one Limit order may affect a dozen open positions because of partial execution, and each position may affect a dozen closed positions. But what if there are several Limit orders? Is it possible to manage in MT4 under such strict conditions? Yes, it is possible and it is implemented in a simple and reliable way.

MT5 does not have any problem with it either. At first glance, it's even easier to navigate than MT4. You won't be confused by the sheer quantity of positions.

But everything changes when you start to complicate the EA's logic. When you need to diversify by running multiple EAs. On MT4 it's elementary and very reliable - just run an EA with other majiks. On MT5 it's a huge hassle from an automation point of view. And in terms of manual intervention in such a trade - it is an impossible task. Because the logic of opening-closingpositions for each strategy in the MT5 terminal is impossible to grasp simply by looking into the terminal. You need to write a proper analyzer. And it cannot be universal, unfortunately.

However, in MT4 there are no such problems. Everything is right in the palm of your hand. Netting in MT4 is implemented in the easiest way for a trader.

This is why MT4 is always more convenient than MT5 in real trading practice and not at the theory level. Although both platforms can be absolutely market driven. I am talking about trading on the MARKET.
 

hrenfx:

Can I use MT4 to work in the MARKET? Yes, you can.
Can I use MT5 to run in the MARKET? Yes, you can.

But what is more comfortable and reliable? Not by theoretical reasoning, but by practical analysis.

More convenient than MT4. Yes, one Limiter, because of partial execution, may affect a dozen open positions, and each position may affect a dozen closed positions. But what if there are several Limit orders? Is it possible to manage in MT4 under such strict conditions? Yes, it is possible and it is implemented in a simple and reliable way.

MT5 does not have any problem with it either. At first glance, it's even easier to navigate than MT4. You won't be confused by the sheer quantity of positions.

But everything changes when you start to complicate the EA's logic. When you need to diversify by running multiple EAs. On MT4 it's elementary and very reliable - just run an EA with other majiks. On MT5 it's a huge hassle from an automation point of view. And in terms of manual intervention in such a trade - it's an impossible task. Because the logic of opening-closingpositions for each strategy in the MT5 terminal is impossible to grasp by a simple glance into the terminal. You need to write a proper analyzer. And it cannot be universal, unfortunately.
I am aware and understand the reasoning very well, Ivan. I just think that manual intervention in "diversification by summing/overlaying strategies" is the last thing. The strategies should be fine-tuned during testing-optimization. As for such diversification, I use it widely - just by summing signals of all sub-strategies before sending the total signal to the synchronizer.If such postulate ("interfere only during debugging") is accepted as a base, it immediately becomes clear that individual observation of each strategy is not a problem at all - they are all individually disabled. Disable all but one and analyze as you wish.

However, in MT4 there are no such problems. Everything is right in the palm of your hand. Netting in MT4 is implemented in the easiest way for a trader.

This is why MT4 is always more convenient than MT5 in real trading practice and not at the theory level. Although both platforms can be absolutely market driven. And that's what I'm talking about when I'm trading in the MARKET.

I told you, I have a similar "netting-synchronizer" written for 4 long time ago. I will just combine all its functions in one class for convenience, and check/rebuild it just in case. Let it fight with a lot of orders later - the strategy itself doesn't care about it all, it will stay as a netting strategy :)
Reason: