A topic for traders. - page 23

 
Uladzimir Izerski #:

Read.

Bloomberg names world's richest families

The combined wealth of the world's richest 25 families is $1.7 trillion, up 22% from a year earlier

They include the owners of Walmart, Mars, Koch Industries and Hermes. The combined wealth of the richest families has grown by 22% over the year

People made more money on clothes and food than on oil.

The money flowed $1.7 trillion from the pockets of ordinary people and not ordinary citizens into the pockets of families.

If all shops were to be taken over by families, there would be fewer customers.

This is not news.


 
Vitaly Muzichenko #:

This is not news.


The picture is right. The social distribution is not right. It's a dead end. It needs a way out. It's already come to that point.

 

By popular demand to talk about my wave system, I have created a small introductory blog. I am too lazy to write an article.

Anyone interested can take a look at the blog. The link as you can see in my profile.

I will answer to your questions in blog that here not to cause an irritation at moderators).

 
Uladzimir Izerski #:

The picture is correct. The social distribution is not right. It is a dead end. It needs a way out. It's already come to that point.

Not quite right:

Quadrant

 
Roman Zamozhnyy #:

Not quite right:


What about, say, wage earners taking bribes and having assets or crooks of all stripes not working but having assets???

We should give them a category.

 
Uladzimir Izerski #:

What about, say, salaried employees who take bribes and have assets or crooks of all stripes who don't work but have assets?

They should be given a category.

They should be given a category in prison.

 

There is a question for experienced progessors.

How to smooth a broken buffer line correctly in a loop? I would be grateful for different options.

 
Uladzimir Izerski #:

There is a question for experienced progessors.

How to smooth a broken buffer line correctly in a loop? I would be grateful for different options.

Mashing by breakpoints
 
Aliaksandr Hryshyn #:
Mash by fracture points

What if I'm interested in getting a smoothing out of the last three or five? That number doesn't quite fit. Are there any other options?

 
Uladzimir Izerski #:

How to smooth a broken buffer line correctly in a loop?

Hi Vladimir!

The correct way to smooth out a broken line without a loop is to use an array to write the values in a circle. The size of the array is equal to the averaging period. The sum in the current element is the actual sum of the last values. We simply divide this sum by the averaging period, and that's it. With this method of averaging, the code execution time does not depend on the averaging period, i.e. everything flies. It goes like this:

input int period=5;

struct My
  {
   datetime time;
   double value;   
   double sum;
   My(){time=0; value=0; sum=0;}
   } my[];
//текущий индекс массива структур
int index=0;

double average=0;

int OnInit()
   {
   if(period<=0)
      {
      printf("аай-я-яй");
      return(INIT_FAILED);
      }
   ArrayResize(my,period);
   return(INIT_SUCCEEDED);
   }

int OnCalculate(...)
   {
   .......
   if(my[index].time!=time[i])
      {
      //следующий индекс в круговом массиве
      index++;
      if(index>period-1) index=0;
      my[index].time=time[i];
      //текущее значение будем добавлять в сумму, а затираемое значение будем вычитать из суммы  
      my[index].sum+=buffer[i]-my[index].value;
      my[index].value=buffer[i];
      //усреднённое значение
      average=my[index].sum/period;
      }
   .........
   return(rates_total); 
   }

At first, until the array is full, zeros in the array will spoil the averaging picture. You can do a check if you need to.