Weekend evening - page 49

 
Vladimir Karputov:

The averaging can be different:

  • for example now - the parameter 'Only one positions' is set to'false' (and it is common, for symbol 0 and symbol 1) -> means that there can be several positions. So there can be a few variants (taking into account that there is a'Close opposite' parameter) - forced closing of opposite positions:
    • several positions of the same type, opened differently: one higher than the other and one lower than the other
    • several positions of different types may be opened one after another ('Close opposite' is set to'false')
  • Volume building can be controlled in the following way (these are new methods, so it's up for discussion) :
    • to build up in increments and in strict adherence to the rule: the next position may be opened'only higher' or'only lower'.
    • only go up if there isa 'loss for one direction' ora 'profit for one direction' (the direction is BUY or SELL on the symbol, NOT TWO symbols)
    • only increase if there is a'combined loss on two directions' or there is a'combined gain on two directions' (direction - BUY or SELL on the symbol, NOT TWO SIGNS)

... Your options

Right, we need to decide on the concept. Either continue to open trades on both pairs simultaneously and target profits on both, or link both pairs by pair correlation, treat both pairs as one, open multidirectional positions on both pairs, thereby hedging large drawdowns without rebounds (where there are usually painful stops) and making money on pair divergence.
Volodya, you are the owner and determine the trend, accept or not accept the development offer. I think the second scenario is promising, the first looks like a chase for two birds).

The averaging itself is optimal in my opinion https://www.mql5.com/ru/code/20612
As far as I remember, one of your Expert Advisors has a similar implementation.
As for the periodicity, I will set the step for now. Eventually, when we are ready, we will refuse this wooden thing and will offer the variant of opening deals and smart stops and tp. But now we need to decide in principle, we will hedge and look to the correlation of pairs, or 2 hares)) it is not clear with the choice of pairs according to what criteria.
 
Valentin Petukhov:
Right, we need to decide on the further concept. Or you may continue to open trades on both pairs simultaneously and take profits on both pairs, or you may bound both pairs by pair correlations, consider both pairs as one, open differently directed positions on both pairs, thus hedging large drawdowns without rebounds (where you usually have painful stops) and making profit on pair differences.
Volodya, you are the owner and you determine the trend, whether or not you accept the development proposal. In my opinion, the second scenario is promising, the first looks like chasing two birds with one stone).

About the averaging itself, in my opinion, the optimal solution is https://www.mql5.com/ru/code/20612.

Now I don't get it: are you saying that it is better throughK correlation of pairs?

 
Vladimir Karputov:

Now I don't get it: are you saying it's better throughK to correlate pairs?

We must have a reason why we choose this combination of pairs, an adequate K-correlation offer and open trades at a certain weekly and daily K-value
 
Anyway, I don't understand anything. As long as we're standing.
 
Vladimir Karputov:
Anyway, I don't understand anything. As long as we're still standing.
Vladimir, it was written in the very first post that pairs behave differently. I suggested the logic of evaluating pair selection, through K correlations, I gave links to articles above. You need to implement K-correlation for the week on both pairs and for the day. If there is positive correlation for the day and positive correlation for the week we open opposite deals and hedge, if there is negative correlation we open unidirectional deals because pairs diverge when there is negative correlation
 
Valentin Petukhov:
Vladimir, it was written in the very first post that pairs behave differently. I suggested the logic of evaluating the choice of pairs, through K-correlation, I gave links to the articles above. You need to implement K correlation for the week on both pairs and for the day. If there is positive correlation for the day and positive correlation for the week we open opposite deals and hedge, if there is negative correlation we open unidirectional deals because pairs diverge when there is negative correlation

I will read it at my leisure (https://www.ig.com/en/trading-strategies/a-trader_s-guide-to-currency-pair-correlations-in-the-forex-mark-191223 )

 
Averaging for each pair separately, with total tp at profit for both pairs.
If we implement tp of each pair separately, then we should put checkboxes in settings, so that it would be possible to choose tp modes during testing, first, second or both. I think the main mode is tp at profit for both pairs, as in the initial idea.

Variant of averaging. To increase it separately for both pairs, if price has moved in the wrong direction for one or both pairs. We open additional orders following the same signal but specifying the minimum step at which the opening condition starts to work, i.e. if we set a 250 point step, it means that the new order will not open earlier than 250 points from the current one and then opens as per our signal.
 
Vladimir Karputov:

Two_Symbols_iRSI_EA. 1.003 Added parameter'Maximum positions' for each symbol.

Put the latest version in the project

 
Valentin Petukhov:

Put the latest version in the project

Version 1.003 was posted immediately and has been in the projects for a long time:

Two_Symbols_iRSI_EA. 1.003

 

Am I correct in assuming that the following have been completed?

1. Executed\An advisor on each pair is run separately and they exchange about the state of the transaction viaglobal variables.

2. Done/If both pairs have profit, then they take it independently.

(Comment. The problem is not set correctly. Then why exchange trade data, if tp is taken separately? It should be a condition, that if both pairs have profit, then all the positions are closed, and tp is taken).

3. not met. \If only one of them is profitable, then the moment they both break-even, they both close the positions.

(Comment. Not reasonable, taking into account the implementation of averaging on both pairs. According to the results of averaging there should be a total tp for both pairs)

4. Executed. Stops for each pair separately. \When there is no profit, there are stops just in case. This point needs to be worked out.

(Comment. Not correct, since profits are calculated using both pairs simultaneously, respectively stop should be calculated using losses of both pairs simultaneously, i.e. 2 pairs - it is a basket and tp and sl for it)

Документация по MQL5: Основы языка / Переменные / Глобальные переменные
Документация по MQL5: Основы языка / Переменные / Глобальные переменные
  • www.mql5.com
Глобальные переменные создаются путем размещения их объявлений вне описания какой-либо функции. Глобальные переменные определяются на том же уровне, что и функции, т. е. не локальны ни в каком блоке. Область видимости глобальных переменных - вся программа, глобальные переменные доступны из всех функций, определенных в программе...