Some signs of the right TCs - page 15

 
Nikolai Semko:

If your TS doesn't need all the history to work, I have bad news for you.

But the impact of history fades exponentially depending on its depth. That's true.

That's why I use a logarithmic representation of history.

I.e. if I use 20 years of history, then the closest weekly story is 80% the size of the whole story.


ZS It's a good analogy with gravity. Did you know that the trajectory of our planet is very much influenced by the gravity of the neighbouring Galaxy, the Andromeda Nebula, to which light travels 2.5 million years?

numbers, numbers, numbers:

The Earth revolves around the Sun at ~30km/sec.

The Sun revolves around the centre of our galaxy at ~ 230 km/sec.

Our Milky Way Galaxy and the Andromeda Nebula galaxy are hurtling towards each other at ~300 km/sec.

ZS The sequel... That's not all

Our galaxy and its neighbouring galaxies are moving towards the M83 galaxy at a speed of ~ 500 km/sec.

In total our galaxy is moving through the Universe at a speed of about 1000 km/sec.

Do you take drugs?

 

Forum on trading, automated trading systems and testing trading strategies

Some signs of good TS

fxsaber, 2020.03.01 21:56

In comments it was suggested to think about the behaviour of TS after inversion of time - ticks go in reverse (from future to past), as if rewind was activated.

There you can also read, on which symbols the inversion may not affect the result of the TS, and for which it is a serious change of market patterns.

Fortunately, forex symbols should not, in theory, destroy market patterns with this time inversion. I found it interesting to test this on one of my TS.


First, the code of tick series inversion in MQL5.

int TimeDayOfWeek( const datetime Date )
{
  MqlDateTime mTime;
  
  TimeToStruct(Date, mTime);
  
  return(mTime.day_of_week);
}

#define  HOUR 3600
#define  DAY (24 * HOUR)
#define  WEEK 7

// https://www.mql5.com/ru/forum/170953/page8#comment_6940794
datetime GetTimeDayOfWeek( const datetime TimeSource, const int Shift = 0, const ENUM_DAY_OF_WEEK Day = SUNDAY )
{
  const datetime Res = TimeSource / DAY * DAY;
  
  return(Res - (((WEEK + (TimeDayOfWeek(Res) - Day)) % WEEK) + Shift * WEEK) * DAY);
}

void ReverseTick( MqlTick &Tick, const long &Offset )
{
  Tick.time_msc = Offset - Tick.time_msc;
  Tick.time = (datetime)(Tick.time_msc / 1000);
  
  return;
}

// Инверсирование времени.
void ReverseTicks( MqlTick &Ticks[] )
{
  const int Size = ArraySize(Ticks);
  
  if (Size)
  {
    const long Offset = (long)(GetTimeDayOfWeek(Ticks[0].time, 0, MONDAY) + GetTimeDayOfWeek(Ticks[Size - 1].time, -1, SATURDAY)) * 1000;

    for (int i = 0; i < Size; i++)
      ReverseTick(Ticks[i], Offset);

    ArrayReverse(Ticks);
  }

  return;  
}


On the basis of this function the script that creates the inverted symbol is attached. We will work with it. The results are as follows.


The Optimizer's best pass on the straight symbol.


The same pass on the time inverted symbol.


No conclusions.


This result is of theoretical interest only. It is difficult to interpret.

There is a code symbol, so that everyone can try his TS on the inverted symbol if desired.

 
Алексей Тарабанов:

Do you take drugs?

From what I can see, it's one of the most edible people on the forum. And you are careful to sort out what you are saying.

 
Uladzimir Izerski:

From what I can see, it's one of the most edgy people on the forum. And you are careful about what you say.

I asked him, not you).

 
fxsaber:

This result is so far only of theoretical interest. It is difficult to interpret.

The symbol code is there, so anyone can try their TS on an inverted symbol if they wish.

Symmetry has shown itself in all its glory. It should be. And I wanted to prove something earlier. (I got impatient))

 
Алексей Тарабанов:

I asked him, not you.)

Don't ask empty and vulgar questions. You are only discrediting yourself in this way.

 
Uladzimir Izerski:

Don't ask empty and vulgar questions. You're only discrediting yourself in this way.

I'm not screwed.

 
Алексей Тарабанов:

I'm not in trouble.

Discreet would be more correct.

 
Nikolai Semko:

...

A proper TS needs a proper data structure, storage and access base.

The current one is very cumbersome and clumsy for creating a proper TS.

I had to develop my own and it turned out, in my opinion, to be much more convenient, compact and nimble.

I can explain in a nutshell.

...

After that you can delete the tick array too and form a logarithmically compressed database of up to 1Mb from the 30-40Mb database. In this database there is a complete picture for the whole symbol history from the current moment.

...

I am interested in "logarithmic compression" of the database. Can you tell me more about it?

 
Vladimir:

Interested in "logarithmic compression" of the database. Can you be more specific?

That's not quite right.

The correct phrase is "compression due to logarithmic scale of data representation".

it's as simple as that.

Here is the unpacked structure of the bar in such a system:

struct iRates {
   double    open;
   double    high;
   double    low;
   double    close;
   datetime  open_time;
   datetime  high_time;
   datetime  low_time;
   datetime  close_time;
   int       volume;
};

with the time period of the bar being different for each bar in the array.

For example, there is a finite array of such bars as 28000.

Time period of the zero bar will be for example 1 second.
time period of the 1st bar will be int(1.00047) = 1 second.
time period of 2nd bar will be int(1.00047^2) = 1 second.
time period of third bar will be int(1.00047^3) = 1 second.
...
the time period of 1500 bar will be int(1.00047^1500) = 2 seconds.
...
the time period of 3000 bar will be int(1.00047^3000) = 4 seconds.
...
the time period of 10000 bar will be int(1.00047^10000) = 109 seconds = 1 minute and 49 seconds
...
the time period of 12000 bar will be int(1.00047^12000) = 281 seconds = 4 min 41 sec
...
the time period of 15000 bar would be int(1.00047^15000) = 1150 seconds = 19.21 minutes ...
...
the time period of 17000th bar would be int(1.00047^17000) = 2945 seconds = 49 minutes ...
...
the time period of 20000th bar will be int(1.00047^20000) = 12061 seconds = 3.35 hours
...
the time period of 25000th bar will be int(1.00047^25000) = 126404 seconds = 1.46 days
...
the time period of 27999th bar would be int(1.00047^27999) = 517331 seconds=5.99 days


The bars are stored in a packed form with an average size of about 20 bytes per bar

index arrays for quick access occupy about 5% of the total size

i.e. the total size of such database would be 28000*20*1.05 = 588 kB, such array would cover 40-50 years of history.

Reason: