Tendential planimetry method - page 3

 
Folks, regarding the analogy between harnesses and magic MAs. "Magicians" claim that when you break a magic MA, price moves powerfully and steadily. This means that on the harnesses we can try an analogue of the crossover strategy, which on the MA quickly leads to a loss. Therefore, please/question. Are there any manual testers here ? It would be interesting to test a harness breakout strategy. I think it would save from a lot of false entries. Alas, I cannot yet write an acceptable density indicator and EA based on it. But I think it would be interesting to check it manually.
 

The density could be calculated from the variance between the values of the different dashes at a given point in time. The lower the variance, the higher the density.

 
I don't think it's difficult. All you have to do is take two wands - the fastest and the slowest. They set the boundaries of the flow, whatever it may be. In harnesses, its width is minimal and equal to the distance between the sleeves. At other times it increases, but still equals the distance between the two sleeves.
 
A question for mql experts. I really want to write a density indicator. Of course, it will not be as beautiful as the rainbow of masks, but it will be much more useful. And what is more important, it may be useful in robotics. In order to draw the density, the entire chart plane will be painted in different colours. After all, the density on the bar is not a number but a distribution, an array. The question is how to do it better? In the Ishimoku indicator, the channel is colored with vertical lines that are objects in the language. In this case there will be many coloured channels. It means that the number of vertical lines in the chart will increase drastically in comparison with Ichimoku. Question, will it cause trouble for the terminal? Another question. Can the coloring be done in a different, more optimal way? As far as I understand, there is no low-level pixel graphics in mql.
 
Yurixx:
I don't think it's difficult. All you have to do is take two wands - the fastest and the slowest. They set the boundaries of the flow, whatever it may be. In harnesses, its width is minimal and equals the distance between the bags. At other times it increases, but still equals the distance between the two slices.

No, these two sleeves do not give a flow boundary. It is often the other way round. This method is only good for a trend. On a flat, you have to watch the visibility of the bezels.
 
eugenk, I think you are slightly exaggerating the complexity of the task. And you also want to load the stone to the limit. What don't you like about the number, i.e. the variance? This indicator is a few lines of code. And you don't have to calculate it on every tick.
 
eugenk:
A question for mql experts. I really want to write a density indicator. Of course, it won't be as pretty as the rainbow of skeletons, but it will be much more useful. In order to draw the density we should paint the whole chart plane with different colours. After all, the density on the bar is not a number but a distribution, an array. The question is how to do it better? In the Ishimoku indicator, the channel is colored with vertical lines that are objects in the language. In this case there will be many coloured channels. It means that the number of vertical lines in the chart will be considerably higher than in the case of lshimoku. Question, will it cause trouble for the terminal? Another question. Can the coloring be done in a different, more optimal way? As far as I understand, there is no low-level pixel graphics in mql.

On the previous page I gave a link to such a strategy. Take a look. It is a pure strategy, nothing automated. But it's worth a look.
 
//+------------------------------------------------------------------+
//|                                                      Density.mq4 |
//+------------------------------------------------------------------+
#property copyright "Mathemat (c) 2007"
#property indicator_separate_window
#property indicator_buffers 1
 
extern int _LoPeriod = 3;
extern int _HiPeriod = 200;
extern int _ma_method = MODE_EMA;
extern int _ma_price = PRICE_CLOSE;
 
double _dens[];   // графический буфер плотности жгута
double _mas[];    // массив машек
 
int init()
{
  SetIndexBuffer( 0, _dens );
  SetIndexStyle ( 0, DRAW_LINE );
  ArrayResize( _mas, _HiPeriod - _LoPeriod + 1 );
  return( 0 );
}
 
// рассчитывает массив машек на заданном баре
void makeMAsArray( int sh )
{
   for( int i = _LoPeriod; i <= _HiPeriod; i ++ )  
      _mas[ i ] = iMA( NULL, 0, i, 0, _ma_method, _ma_price, sh );
   return;
}
 
// возвращает с.к.о. текущего массива машек 
double stderr( int quantity )
{
   double linsum = 0;
   double sqwsum = 0;
   for( int i = 0; i < quantity; i ++ ) 
   {
      linsum += _mas[ i ];
      sqwsum += _mas[ i ] * _mas[ i ];
   }   
   return( MathSqrt( sqwsum / quantity - linsum * linsum / ( quantity * quantity ) ) );   
}
 
 
int start()
{
   int limit = Bars;
   int counted_bars = IndicatorCounted();
   if( counted_bars > 0 )  counted_bars--;
   limit = Bars - counted_bars;
   
   for( int sh = 0; sh < limit; sh ++ )
   {
      makeMAsArray( sh );
      _dens[ sh ] = 1 / stderr( _HiPeriod - _LoPeriod + 1 );
   }
   return( 0 );
}

This inductor shows the density of the harness based on the variance within the mashes for each bar. The strokes are exponential. The calculations are a bit unrealistic. Oh, and its main drawback is that it is not normalised.

P.S. I admit the futility of an approach based on variance calculation: a powerful harness can also be where the dispersion of different wipes is large.

 

Two indicators can be used to judge the density of swabs: the number of swabs per interval and the interval between swabs. I find the second possibility interesting. Of course, some averaging is needed. In other words, we calculate function (interval occupied by n sames)[(average or median value of those n sames) over the full range of sames (sames should be ordered by their value), find its minima and draw stripes, say, by half-height. We can take n at a glance about 10. Although in fact, both n and the way of defining stripes boundaries should be chosen as you go along, looking at the resulting pictures.

 

The problem is that we need to learn how to calculate the mashups even more optimally than in the standard metacvot package. We need some recurrence algorithm for calculating mashes, where a mash of period N is calculated using a known mash of period N+1. In principle it is not difficult, but then one has to reject the standard metacquot algorithm.

As for the density of bags: we obviously need some kind of clustering algorithm, because they can be very heterogeneous vertically (for a given bar). In short, the task is not technically easy at all.

P.S. The efficiency of a thousand iMA() calls from 3 to 1002 is about 500 000 operations (additions) ~ 1000 * 1000 / 2. If to do recurrence algorithm (knowing scale of period N, simply multiply by N, add farthest new price and divide by N+1; we get scale of period N+1) - efficiency will depend linearly on N.