Libraries: BestInterval - page 17

 
Andrey Khatimlianskii:

Is there an easy way to leave your OnTester working after connecting BestInterval?

It doesn't help:

It still returns the final balance (and you need your own complex criterion, BESTINTERVAL_ONTESTER_FORMULA doesn't solve the problem).

#define  BESTINTERVAL_ONTESTER // The optimisation criterion is the profit of the best interval.
#define  BESTINTERVAL_CALL_ONFUNCTIONS // OnTester will be called in BESTINTERVAL_ONTESTER mode и OnTimer.
#include <fxsaber\BestInterval\BestInterval.mqh> // Calculation of the best trading interval

double OnTester()
{
  Print("Hello World");
  
  return(123);
}

In the log you will see Print triggered, i.e. OnTester will be executed. But no more than that - its result is ignored.


You need this

#define  BESTINTERVAL_ONTESTER // The optimisation criterion is the profit of the best interval.
#define  BESTINTERVAL_ONTESTER_FORMULA MyOnTester()
#include <fxsaber\BestInterval\BestInterval.mqh> // Calculation of the best trading interval

input int Input = 0;

double MyOnTester()
{
  return(123);
}


Result

pass 1 returned result 123.000000 in 0:00:00.468
pass 0 returned result 123.000000 in 0:00:00.469
 
Andrey Khatimlianskii:


ps: the latest build of MT5 has a lot of warnings "deprecated behaviour, hidden method calling will be disabled in a future MQL compiler version" when compiling.

What would it mean?

 
fxsaber:

You need this

Does not work with Amount of Delete Intervals = 0.

In testing I have reached this EA:

#define  BESTINTERVAL_ONTESTER // The optimisation criterion is the profit of the best interval.
#define  BESTINTERVAL_ONTESTER_FORMULA MyOnTester()
#include <fxsaber\BestInterval\BestInterval.mqh> // Calculation of the best trading interval

input int inputParam = 0;

double MyOnTester()
{
  return(inputParam*100);
}

When Amount of Delete Intervals = 0, it returns the starting balance in all passes.

If Amount of Delete Intervals = 1, it returns expected values.

 
Andrey Khatimlianskii:

Does not work with Amount of Delete Intervals = 0.

In the checks I came to this EA:

When Amount of Delete Intervals = 0, it returns the starting balance in all passes.

If Amount of Delete Intervals = 1, it returns expected values.

On line 713.

  if (!inBestInterval_Action && inAmountDeleteIntervals)

remove the second condition.

 
fxsaber:

Line 713

remove the second condition.

It's up! Thank you.

 

In such universal libraries, I put the input parameters in a separate file and wrap them with ifdef, so that I can insert them in the right place without watching the order in which the library files themselves are connected (which may play a role).

Maybe there is another, more elegant way to manage the order of inputs?

 
Andrey Khatimlianskii:

Maybe there is another, more elegant, way to manage the order of the inputs?

I've never bothered with such cosmetics. There are so many other things to do...

It would be nice to have a place to discuss promising things. It's almost completely silent.

 
fxsaber:

It would be nice to have somewhere to discuss forward-looking stuff. It's almost completely silent.

There is an opinion that profitable strategies cannot be discussed publicly. That's why there are only rudiments of research on the forum, and at the first (even accidental) meeting with a golden grain - going underground.

I am always in favour of discussion, but I will not help much in terms of trading, I am more focused on technical issues.

 
Andrey Khatimlianskii:

I'm always in favour of discussion

With a large number of trades and throw away intervals comes an interesting object of study.

Profit = 55367.00 = 54785.00 + 582.00 (1.06%) - Amount of Delete Intervals = 20
00:00:00 - 02:29:28 : Profit = 8460.00 (15.28%), Total = 293 (88.74%), PF = 4.95, Mean = 28.87, DD = 298.00, RF = 28.39
02:34:20 - 03:06:49 : Profit = 763.00 (1.38%), Total = 74 (79.73%), PF = 1.64, Mean = 10.31, DD = 696.00, RF = 1.10
03:12:43 - 03:46:29 : Profit = 1067.00 (1.93%), Total = 76 (75.00%), PF = 2.07, Mean = 14.04, DD = 440.00, RF = 2.43
03:54:37 - 07:15:26 : Profit = 3641.00 (6.58%), Total = 327 (77.68%), PF = 1.66, Mean = 11.13, DD = 1183.00, RF = 3.08
07:30:54 - 09:16:59 : Profit = 2452.00 (4.43%), Total = 253 (79.45%), PF = 1.57, Mean = 9.69, DD = 877.00, RF = 2.80
09:34:03 - 09:42:17 : Profit = 865.00 (1.56%), Total = 42 (83.33%), PF = 3.03, Mean = 20.60, DD = 177.00, RF = 4.89
09:42:19 - 09:51:57 : Profit = 1389.00 (2.51%), Total = 51 (84.31%), PF = 4.99, Mean = 27.24, DD = 93.00, RF = 14.94
09:56:38 - 10:04:58 : Profit = 1351.00 (2.44%), Total = 75 (82.67%), PF = 2.52, Mean = 18.01, DD = 350.00, RF = 3.86
14:22:11 - 14:46:12 : Profit = 2167.00 (3.91%), Total = 110 (78.18%), PF = 3.33, Mean = 19.70, DD = 488.00, RF = 4.44
14:51:09 - 15:01:51 : Profit = 1511.00 (2.73%), Total = 69 (79.71%), PF = 2.68, Mean = 21.90, DD = 353.00, RF = 4.28
15:04:47 - 15:46:23 : Profit = 3605.00 (6.51%), Total = 297 (76.09%), PF = 1.75, Mean = 12.14, DD = 670.00, RF = 5.38
15:54:05 - 16:04:53 : Profit = 2051.00 (3.70%), Total = 103 (82.52%), PF = 2.65, Mean = 19.91, DD = 299.00, RF = 6.86
16:08:24 - 16:15:39 : Profit = 896.00 (1.62%), Total = 56 (78.57%), PF = 2.22, Mean = 16.00, DD = 167.00, RF = 5.37
16:21:19 - 16:44:18 : Profit = 2159.00 (3.90%), Total = 184 (79.89%), PF = 1.71, Mean = 11.73, DD = 352.00, RF = 6.13
16:54:29 - 17:01:09 : Profit = 1457.00 (2.63%), Total = 68 (82.35%), PF = 4.70, Mean = 21.43, DD = 118.00, RF = 12.35
17:10:30 - 17:30:56 : Profit = 2858.00 (5.16%), Total = 178 (78.09%), PF = 2.07, Mean = 16.06, DD = 431.00, RF = 6.63
17:41:23 - 17:51:28 : Profit = 989.00 (1.79%), Total = 88 (76.14%), PF = 1.65, Mean = 11.24, DD = 478.00, RF = 2.07
17:53:57 - 18:51:41 : Profit = 4399.00 (7.95%), Total = 449 (73.72%), PF = 1.53, Mean = 9.80, DD = 635.00, RF = 6.93
18:56:38 - 19:41:09 : Profit = 1646.00 (2.97%), Total = 181 (75.14%), PF = 1.51, Mean = 9.09, DD = 474.00, RF = 3.47
19:44:55 - 20:03:20 : Profit = 1492.00 (2.69%), Total = 70 (78.57%), PF = 3.25, Mean = 21.31, DD = 130.00, RF = 11.48
20:11:31 - 23:59:59 : Profit = 10149.00 (18.33%), Total = 659 (77.24%), PF = 2.12, Mean = 15.40, DD = 645.00, RF = 15.73
SUMMARY: 00:00:00 - 23:59:59 : Profit = 55367.00 (100.00%), Total = 3703 (78.50%), PF = 2.04, Mean = 14.95, DD = 1247.00, RF = 44.40

We need to figure out how to identify good chunks of trades from this data. There has to be a combination of a decent number of trades in a chunk, serious gains per unit of time, etc. I have not been able to formalise this yet.


The task is approximately as follows: given a large number of discarded intervals, determine probably system chunks and only on their basis calculate a custom Optimisation criterion.

The solution of the problem will allow to reveal the potential of TC much more.

 
fxsaber:

I haven't been able to formalise it yet.

then this is a task for a neural network, prepare the data by hand and train the NS, then in the future you will evaluate the results using the trained NS.

FN: if on fingers, how to teach the multiplication table to NS https://www.mql5.com/ru/forum/8265/page2#comment_333746 (I probably already bored everyone with this example )))) ) - you give data to the inputs, the output is your evaluation, let it be on a 3-point scale: excellent, good, unsatisfactory - the NS copes with this task perfectly well, but you will have to prepare the data by hand, or rather classify what you think is a good/bad result.