Author's - page 8

 
alexeymosc:

Thank you Mr Human.

Where do the "long" and "short" signals come from, did you write them in the code yourself?

I do not understand your question. What do you mean, I wrote it myself? How do you interpret the patterns?
 
her.human:

Let's say we find the mostfrequent pattern, what does this pattern tell us? What should we do next, buy or sell?

Without dividing into buy and sell it is impossible to calculate the total number of patterns and therefore the average.

In this case it is easier for me to answer in code.
Files:
 
hrenfx:
In this case it is easier for me to answer with code.

One dick is only a side view.

In my case only two arrays(arr_buy andarr_sell) are used to store all pattern information,

which are easy to save in case of forced restart of Expert Advisor, so we don't lose statistics.

In your case, besides a single arrayPatterns[index], there are several static variables that you can't do without,

for examplestatic int Element[];

static int PrevIndex = -1;

Initially, I also began to write with one array, but then I gave up.

Regarding identification of patterns and removing of an indicator: I haven't understood your code yet (it is more complicated without comments).

PS. I understood you have no possibility to take into account the absence of signal (no pattern), it is supposed that there is always a signal?

 
There must be at least 3 regions of market condition space (buy/sell/undefined). That is, there are two areas that are clearly identifiable, and one to which undefined states belong.

Ideally there should be 4: buy/sell/undecided/unknown (unseen before), but in practice it is not feasible to implement such a scheme, 3 is sufficient.

 
her.human:
I don't understand the question, what do you mean by self-prescribing? How do you imagine interpreting the patterns?
I honestly haven't parsed the code. That's why I'm asking in simple words: what patterns are written, what are they, and where do the binary signals come from, from the history? It's not clear.
 
her.human:
The EA is, of course, written only for the tester. Therefore, there can be no loss of statistics when the EA is forced to restart.

Array static int Element[] is declared in this way only for expediency not to allocate memory for it at each function call. I.e. the static element can be removed.

All the description is given here. That's why, in particular, there are no comments in the code.

The signal, indeed, is always there (as in your case). But the flip happens only at the threshold. Closing at the moment of signal uncertainty as you have:

if(stat_sign<porog_clos && PositionGetDouble(POSITION_PROFIT)>0.0)
  trade.PositionClose(_Symbol); // выход из позиции
I did not do it.
 
joo:
There must be at least 3 areas of market conditions (buy/sell/undetermined). I.e. there are two areas that are clearly identifiable, and one to which the undefined states belong.

Ideally there should be 4: buy/sell/undefined/unknown (previously unseen), but in practice it is not practical to implement such a scheme, 3 is enough.

In the above EA code, this is roughly how it is done. There are 4 states that are written in two one-dimensional arrays that can be further interpreted in any way.

1. buy=0, sell=0, - no signals

2. buy=1, sell=0, - buying

3. buy=0, sell=1, - sale

4. buy=1, sell=1, - uncertainty, it is possible to buy and sell, or stay on the fence waiting for certainty (whatever you like)

How to interpret it myself is not clear yet.

 
alexeymosc:
To be honest, I haven't parsed the code. That's why I'm asking in simple words: what patterns are written, what are they, and where do binary signals come from, from history? It's not clear.

Potterns are recorded, on each new bar, of length 10 bits (can be added if desired). This produces 1024 different combinations of signals.

Each bit of the pattern is one of the simple (binary) signals to choose from (17 kinds have been made so far, the first one that came to mind).

For example:

  • price above the bag - 1, price below the bag - 0;
  • high1>high2 - -1, high1<high2 - 0;
  • time before lunch -1, time after lunch - 0;

etc...

Of course, from the history, and where else to get it from, the future is unknown.

Обработчик события "новый бар"
Обработчик события "новый бар"
  • 2010.10.04
  • Konstantin Gruzdev
  • www.mql5.com
Язык программирования MQL5 позволяет решать задачи на совершенно новом уровне. Даже те задачи, которые уже вроде имеют решения, благодаря объектно-ориентированному программированию могут подняться на качественно новый уровень. В данной статье специально взят простой пример проверки появления нового бара на графике, который был преобразован в достаточно мощный и универсальный инструмент. Какой? Читайте в статье.
 

A few selections of input parameters:

Bad, of course, even though 2.5 years old the TS is constantly in the market. But that's not the point.

 
her.human:


  • price above the wand - 1, price below the wand - 0;
  • high1>high2 -1, high1<high2 - 0;
  • time before lunch -1, time after lunch - 0;

etc..


That's what I was wondering. Thanks for the explanation. So it is a priori assumed that if the price is above the wrist, it is an indication of upward movement, etc.?