Tendential planimetry method - page 4

 
Mathemat:

but then you would have to reject the standard meta-quota algorithm.


It has to be rejected, if time is of the essence.
 
Mathemat:

The problem is that we have to learn how to calculate the mashups even more optimally than in the standard meta-quote 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.

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

We can make an indicator, in which the last hundred (if we use one hundred bags) values return the values of the bags. But in this case it will be only for SMA. The algorithm is a bit different for the other wands, but in principle it is also feasible.
 

I don't quite understand, Victor. Please explain in more detail. What is "last hundred" in one-dimensional array?

In principle, recurrence in the meta-quotes algorithm is already built in for all wizards. But it's good for calling wipes of the same period. And our periods are different every time.

 
Mathemat:

In principle, recurrence in the meta-quote algorithm is already built in for all wizards. But it is good for calls to mashups of the same period. And our periods are different every time.

for (i = 2; i<=N;i++) {
  Sum += Close[i];
  MA[i] = Sum/i;
}
P.S. It seems that sums should also be arrays :)
 
Mathemat:

I don't quite understand, Victor. Please explain in more detail. What is "last hundred" in one-dimensional array?

In principle, recurrence in the meta-quotes algorithm is already built in for all wizards. But it's good for calling wipes of the same period. And we have different periods every time.


If you count by the average,

int i,j;
double sum=0, Count;
for (i=0;i<100;i++) {
   for (j=0;j<step;j++) {
       sum+=Close[i*step+j];
       Count++;
   }
   Buffer[i]=sum/Count;
}
Something like that.
 

That's not what I meant.

double SMA( int newperiod, int sh, double SMAprev )
{
   return( ( SMAprev * ( newperiod - 1 ) + Close[ sh + newperiod - 1 ] ) / newperiod );
}

Instead of an expensive call to iMA() (which will add up a bunch of summands), the function calculates a mask with period incremented by 1 regardless of period. So, in fact, iMA() can be called only once on each counted bar, first and last.

For EMA a similar algorithm is also recurrent, although not as obvious. SMMA is equivalent to EMA, only LWMA remains to be seen.

 
Calling any function is an additional overhead. If, on the other hand, an amount is memorised instead of an SMAprev, several operations can be avoided.
 
Well yes, the amount is remembered, or rather the former SMA. No problem to post two codes doing a thousand calculations on one bar with the standard method, and the same with my method. And compare their efficiency.
 

Of course it's faster. But I'm talking about 'even faster' :). Compare it to mine, which is above.

 
Aha, Candid, got it now. For an arbitrary bar with a shift sh:

// размер массива SMA[] уже установлен равным N+1 перед вызовом функции
void createSMAsArray( int sh, double& SMA[] ) 
{
   double Sum = 0;
   for ( int i = 1; i <= N; i ++ ) 
   {
     Sum += Close[ sh + i - 1 ];
     SMA[ i ] = Sum / i;
   }
   return;
}
Is it like that? Note the initial summation index.