Stochastic indicator. A curious observation. - page 7

 
Yurixx:

I offered Leonid an elementary solution to the problem. It requires some minor modification of the code, which anyone not too experienced in MQL, can do. Leonid is one of them. And he did it for free. And I haven't even seen the Expert Advisor's code. And I can still say that your question is being solved.

My virtual trading library can also be plugged in by "not too smart in MQL". Including Leonid.
But I spent quite a lot of time to write it, therefore it's not "Free" but "Inexpensive".
Besides, your "elementary solution to the issue" only solves the problem in a particular case (when there is no SL/TP/TS), while mine is universal.

Yurixx:

Can you do cooler? For cheap ? :-) I don't doubt it. Me neither. For free. Shall we compete?

Go ahead, I am not afraid of competition ;)
If you solve Leonid's problem for free, I'll be only too glad.
And if you can't, I will solve it for money.

No one forbids helping for free. I myself sometimes do just that.
Most of the time I just don't have the time or inclination to solveother people's problems.
 

Andrei, have you decided to ask Leonid to buy your library? That's great. That's your job.

But you've decided to kick my offer for lack of versatility. First of all, that's ridiculous. It doesn't suggest any universality at all, just a simple solution to a specific situation. Although the problem you have outlined can also be perfectly solved within its framework. You know this very well. Secondly, it is not very correct. You should not rub elbows even when fighting for clients. I have not provoked you to do it and I have not crossed your path.

 
Yurixx:

Andrei, have you decided to offer Leonid to buy your library? That's great. That's your job.
But you decided to kick my offer for its lack of versatility.

Wait. What was the "kicking"?
In the phrase "What about the triggering of SL/TP positions? If SL bye is triggered, F should become = 0, but it stays == 1"?
Not even a thought of kicking anyone, much less kicking them. If I offended,I apologize.

Yurixx:

First of all, that's ridiculous. It doesn't suggest any universality at all, just a simple solution to a specific situation.

Leonid himself wrote: "Without trailing stop-losses you can trace the prohibited LONG-trade by its stop-loss and take-profit. But with trailing..... I have no idea how to approach the solution....".
He knows how to solve the problem without trailing, it was the solution with trailing that was of interest.
So your suggestion was not quite appropriate (it did not contain a solution to the problem).

I offered a tool to solve this very problem. Specifically for Leonid.

Yurixx:

Although the problem you have identified can also be solved perfectly within its framework. You know this very well.

How?
  • Remember the level of the virtual SL when it is virtually opened,
  • add a virtual modification with a change in the remembered level,
  • add tracking of virtual SL/TP triggering?
It's not a full-fledged library, of course, but it's not 5 lines of code either, you'll agree.
Or is there a simpler solution, which I am not aware of?

Besides, then there will be the question of incorrect results due to:
- incorrect permutation of SLs (or should the distance check block be added too? a few more lines...),
- missing data saving block in case of reloading ("opened" virtual position, reloaded the terminal but it's already gone),
- incorrect triggering of the SL after a pause in work (the price could "move" beyond the SL and return during the pause. When we restart the Expert Advisor, it did not trigger the SL),
- something else...

Yurixx:

Secondly, this is not very correct. It's not worth elbowing around even in a fight for customers. I have not provoked you to do so and I have not crossed your path anywhere.

Again, I apologize if I have "shoved", "kicked" or "offended".
Yes, and fight for the client, I do not see - we're not arguing about who does the job better, we are generally in different categories (in this situation): I offer services for a fee, and you free help. What kind of competition can there be? ;)
 
Shinigami:
Is it really so hard to write
sumlow+=HighesBuffer[k]-Close[k];
sumhigh+=HighesBuffer[k]-LowesBuffer[k];
instead of the original
sumlow+=Close[k]-LowesBuffer[k];
sumhigh+=HighesBuffer[k]-LowesBuffer[k];
and compile?
We will get a mirror copy. We do not get anything new for it will be the same but in a mirror image.
In order to get a new stochastic we need a new formula, and until it is absent, there is no sense in twisting it back and forth, there will be no result.


Shinigami, I did that and got it:

But that's not what I meant when I was talking about mirroring. At the moment the stochastic is calculated from the price minimum to the maximum, i.e. the stochastic scale has a dimension from 0 to 100.

I want the stochastic to be calculated inversely. From the price maximum to its minimum. I.e. I want the scale to get from 0 to "-100".

Maybe, someone has implemented such a variant?

 
WPR applies.)
 

Hello all. Here is another interesting observation. The Expert Advisor based on the tactics shown in the picture in the previous message seems to be able to work profitably. However, I have modified its operation by making long and short positions independent of each other. I.e. I have obtained two versions united in one Expert Advisor. In accordance with the idea described in https://www.mql5.com/ru/articles/1485

One version is BUY only, the other is SELL only.

GBPJPY, M30, C 1 Jan. 2007 to Seg.

Note the drawdown in united mode.

 
leonid553:

Hello all. Here is another interesting observation. The Expert Advisor based on the tactics shown in the picture in the previous message seems to be able to work profitably. However, I have modified its operation by making long and short positions independent of each other. I.e. I have obtained two versions united in one Expert Advisor. In accordance with the idea described in https://www.mql5.com/ru/articles/mt4/_my/403

One version is BUY only, the other is SELL only.

GBPJPY, M30, C 1 Jan. 2007 to Seg.

Note the drawdown in united mode.


How about looking at all the ticks?
 

Why? The Expert Advisor works at the OPENING PRICES - it is stated so in the code algorithm. But when running it by ALL TICKETS the result differs by ten or two pips, no more! Just now I've done it.

Profit was close to a cent, and drawdown was slightly more - by 30 pips!

 
leonid553:

Why? The Expert Advisor works at the OPENING PRICES - it is written in the code algorithm. But when running it by ALL TICKETS the result differs by ten or two pips, no more! Just now I've done it.

Profit was close to a cent, and drawdown was slightly more - by 30 pips!


If the Expert Advisor really works on opening prices, then there should be no difference between "all ticks" and "opening". There is something wrong here.
 

Perhaps the point is that ON ALL TICKS are present:

"Schedule mismatch errors" = 2 errors. I do not see any other explanation. In addition, when recalculating in Unified mode, one deal was added.

Unfortunately, such Stochastic Expert Advisors do not guarantee good enough profit out of sample, i.e. out of the optimization period. After optimization on the history=1 year (approximately), the profitable parameters "hold" in the most cases not longer than 1 week. It is 3-10 trades. Then it is clearly dumped. With few exceptions. True, one of my acquaintances obtained quite good results with large stoploss (by times larger than takeprofit). But I didn't go that way.

After various experiments and observations online, the trend began to be determined. Due to their structure Stochastic Expert Advisors "love" to go against the trend. Even if we manage to get a good profit during optimization, it is much more modest online. Nevertheless we have succeeded to reliably set the main CRITERIUM for getting profit outside the optimization period. This criterion turned out to be PROFITABILITY !

If profitability at optimization exceeds 2.0, we can conclude with high probability that we will profit outside the sample! And if we manage to minimize the drawdown, it will be quite good! But how to increase the profitability?

In this case it seems reasonable to prohibit the Expert Advisor to work against the trend. And see what happens. This idea has turned out to be correct! A couple of days ago I managed to find a simple, amazing software solution for detection of presence/absence of a trend. After that I inserted this solution into my Expert Advisor and its profitability never drops below two! And as a general result there are good prospects for profit outside the optimization period. Curiously, the total history profit has not virtually increased. The drawdown has not decreased either. But the reliability has increased! Only in tester so far, but ....., I will not hurry....

Here are the graphs of the filter: For long trades -

And for short trades -