# Discussion of article "Self-adapting algorithm (Part III): Abandoning optimization"

Moderator
233018

New article Self-adapting algorithm (Part III): Abandoning optimization has been published:

It is impossible to get a truly stable algorithm if we use optimization based on historical data to select parameters. A stable algorithm should be aware of what parameters are needed when working on any trading instrument at any time. It should not forecast or guess, it should know for sure.

In the new version, I decided not to use candles because of their unstable parameters. More precisely, only M1 candles are to be used because moving on to handling ticks leads to a significant increase in resource consumption. Ideally, it is better to handle ticks.

I will analyze blocks of N points. The blocks are similar to renko but they are based on a slightly different algorithm. I have already mentioned block charts and their advantages in analysis in the article "What is a trend and is the market structure based on trend or flat".

Figure 1. Block chart

Figure 1 shows a block chart. The general view of the block chart is shown in the bottom part of the figure, while the upper image demonstrates how blocks look on the price chart. BLocks are built into the past and future from a fixed time. In the figure, the fixed time is shown as a yellow vertical line. This is a zero point, from which blocks are built into the past and future. The construction algorithm is mirrored. The fact that the blocks are built into the past and the future will be important in further development.

Blocks are needed because their main parameters are stable, controllable and, most importantly, profit/loss depends mainly on price movement in points.

Author: Maxim Romanov

2980

GREAT work,

thank you!

1578

I hope you noticed that your box calculation algorithm as you published it, has a repainting factor specially when the market goes side way and horizontal boxes are being drawn. Every now and then after the horizontal zone is broken, the number of boxes differs in the history. Knowing that you are looking in the number of boxes, I can think of two different solutions :

1- find the reason for this repainting and fix it

2- find a way to identify these horizontal zones and count 1 for bullish and 1 for bearish boxes and don't calculate the rest of the boxes being drown on this zone !

These pictures should help.

In the first picture we see total of 5 boxes : https://prnt.sc/10secab

In the second picture, with addition of a single box, not only we loose that horizontal drawing , but also two boxes being drawn bellow the others : https://prnt.sc/10seczw

And few box later, we get three boxes instead of 5 : https://prnt.sc/10segad

The second condition shows that we can't even rely on the 1-1 counting scenario, how ever, if we would not care about the noise, we can see 5 boxes there, however, the last picture shows that we can't rely on this "assumption" and the number of boxes will differ during on time. I am not using the ATR setting with default values for the indicator (just flipped the colors) on GBPUSD-M1.

As I see it, you should really sit back and find this repainting (recalculating with different result) issue before proceeding forward.

Screenshot
• prnt.sc
Captured with Lightshot
9909

Alireza Khodakarami:

I hope you noticed that your box calculation algorithm as you published it, has a repainting factor specially when the market goes side way and horizontal boxes are being drawn. Every now and then after the horizontal zone is broken, the number of boxes differs in the history. Knowing that you are looking in the number of boxes, I can think of two different solutions :

1- find the reason for this repainting and fix it

2- find a way to identify these horizontal zones and count 1 for bullish and 1 for bearish boxes and don't calculate the rest of the boxes being drown on this zone !

These pictures should help.

In the first picture we see total of 5 boxes : https://prnt.sc/10secab

In the second picture, with addition of a single box, not only we loose that horizontal drawing , but also two boxes being drawn bellow the others : https://prnt.sc/10seczw

And few box later, we get three boxes instead of 5 : https://prnt.sc/10segad

The second condition shows that we can't even rely on the 1-1 counting scenario, how ever, if we would not care about the noise, we can see 5 boxes there, however, the last picture shows that we can't rely on this "assumption" and the number of boxes will differ during on time. I am not using the ATR setting with default values for the indicator (just flipped the colors) on GBPUSD-M1.

As I see it, you should really sit back and find this repainting (recalculating with different result) issue before proceeding forward.

Yes, blocks do redraw if they are drawn to the left of a fixed time. I know this is not a problem, this is done on purpose. For those purposes that use this indicator, this situation is a plus. When the blocks are being built, due to their fixed size, create some kind of inaccuracy in determining the trend area. To reduce this error to a minimum and find the maximum trend scale, such a mechanism was made. When blocks are drawn to the right of the fixed time, they are not redrawn.