Libraries: BestInterval - page 3

 
fxsaber:

I wouldn't be surprised if it was running on Netting. CloseBy doesn't work there.

Do it on a hedge. I didn't bother with it for netting, because MT4-advisor was not supposed to be run in this mode, of course.

Yeah, it's kind of a hedge. Or is it set up somewhere else in MT5?

Account type

 
Mikola_2:

I think it's a hedge. Or is it still customisable somewhere else in MT5?

I haven't run Tester on regular MT5 symbols for several months. Maybe I have not taken something into account.

Write the name of the trading server, I'll check it.

 
fxsaber:

I haven't run Tester on MT5 symbols for several months. Perhaps I have not taken something into account.

Write the name of your trading server, I will check it.

AlpariEvrasia-MT5-Demo
 
Mikola_2:
AlpariEvrasia-MT5-Demo

Server does not support CloseBy

Forum on trading, automated trading systems and testing trading strategies

PositionCloseBy not working in real accounts

fxsaber, 2018.07.24 16:42

bool IsCloseBy( const string Symb )
{
  return(SymbolInfoInteger(Symb, SYMBOL_ORDER_MODE) & SYMBOL_ORDER_CLOSEBY);
}


ZY Updated Sync.mqh. CloseBy is not used anymore. It is easier to analyse history in reports and charts. Thanks for the report!

This is how the trades and the thrown interval look on the Tester chart

 

On MQ demo server data always loss -1127 with 10K initial.

It was better on FxChoice.


I didn't see any difference on this Expert Advisor, but I found a bug :)

When connecting the library, Virtual cannot compile the line with OrderSend.


I'm lying, the result is shown :)

2018.10.16 23:35:38.620 Core 1  2018.10.12 23:59:59   Amount of Delete Intervals = 0
2018.10.16 23:35:38.620 Core 1  2018.10.12 23:59:59   00:00:00 - 23:59:59 : Profit = 2637.54, Total = 2641 (30.48%), PF = 1.11, Mean = 1.00, DD = 14834.15, RF = 0.18
2018.10.16 23:35:38.620 Core 1  2018.10.12 23:59:59   SUMMARY: 00:00:00 - 23:59:59 : Profit = 2637.54, Total = 2641 (30.48%), PF = 1.11, Mean = 1.00, DD = 14834.15, RF = 0.18
2018.10.16 23:35:38.620 Core 1  2018.10.12 23:59:59   
2018.10.16 23:35:38.620 Core 1  2018.10.12 23:59:59   Amount of Delete Intervals = 1
2018.10.16 23:35:38.620 Core 1  2018.10.12 23:59:59   15:34:37 - 19:55:39 : Profit = 18700.06, Total = 827 (32.77%), PF = 9.58, Mean = 22.61, DD = 632.22, RF = 29.58
2018.10.16 23:35:38.620 Core 1  2018.10.12 23:59:59   SUMMARY: 00:00:00 - 23:59:59 : Profit = 18700.06, Total = 827 (32.77%), PF = 9.58, Mean = 22.61, DD = 632.22, RF = 29.58


Files:
 
fxsaber:

The server does not support CloseBy

ZY Updated Sync.mqh. CloseBy is no longer used. It became easier to analyse history in reports and charts. Thanks for the report!

This is how trades and the thrown interval look on the Tester chart

Urrraaaaah, it worked! :)))) I just need to make some adjustments to make the numbers match.

Here is a preliminary run:

Action = false

Here's one with Action = true:

Action = true

Here are the Tester stats:

Tester 1 Tester 2

 
Mikola_2:

Urrrraaaaah, it works! :)))) I just need to make some adjustments to make the numbers match.

When Action = false OnTester shows the profit corresponding to the calculated best interval.

With Action = true (this mode makes sense only on single passes) OnTester shows the final balance that corresponded to Action = false;


I.e. when Action is on, OnTester will show the result as if the best interval does not exist. Thus you can understand by how many per cent the result has improved by comparing the data in two rows: final balance and OnTester result.


As for the null SUMMARY when Action = true. This is not an error. I made it so that I could understand that the Action = true mode is running. It will be necessary to report it differently and fill SUMMARY correctly. It's just that it's of little use, because all this data is already in the Tester's report.

 
...:

On MQ demo server data always loss -1127 with 10K initial.

It was better on FxChoice.

Forum on trading, automated trading systems and testing trading strategies.

Libraries: BestInterval

fxsaber, 2018.10.16 23:51

On regular MT5 symbols have not run Tester for several months.


I didn't see any difference on this EA, but I found a bug :)

We need data to reproduce a critical error.

When connecting the library, Virtual cannot compile the line with OrderSend

The description of Virtual says that it works only for MT4-style codes. Your EA is MT5-style. Therefore, it will not compile with Virtual. Moreover, Action = true will not work as well, because Virtual trading environment is used there. However, Action = false will work. That is why for MT5-style you should add only these lines

#include <MT4Orders.mqh> // https://www.mql5.com/en/code/16006

#define  BESTINTERVAL_ONTESTER
#include <fxsaber\BestInterval\BestInterval.mqh>


I write everything in MT4-style. It is so convenient and universal.

 
fxsaber:

If Action = false OnTester shows the profit corresponding to the calculated best interval.

When Action = true (this mode makes sense only on single passes) OnTester shows the final balance that corresponded to Action = false;

I.e. when Action is on, OnTester will show the result as if the best interval does not exist. Thus you can understand how much per cent the result has improved by comparing the data in two rows: final balance and OnTester result.

As for the null SUMMARY when Action = true. This is not an error. I made it so that I could understand that the Action = true mode is running. It will be necessary to report it differently and fill SUMMARY correctly. It's just that it's of little use, because all this data is already in the Tester's report.

Nope... :)

Look, there are four digits:

Action = false: final balance 9080.02

OnTester 11895

Action = true: final balance 13271.09.

OnTester 12931.

None of them match. It seems to me that OnTester summarises the total somewhere incorrectly.

And something must match with something, otherwise how to make sure that everything is calculated correctly... :)

 
Mikola_2:

Nope... :)

Look, there are four digits:

Action = false: final balance 9080.02

OnTester 11895

Action = true: final balance 13271.09

OnTester 12931

None of the items match. I think OnTester does not summarise the total correctly somewhere.

And something must match something, otherwise how can you be sure that everything is calculated correctly... :)

It's very easy to explain. The highlighted number is the final balance in the virtual trading environment. Its profit is calculated with TickValue = 1. And MT5-Tester changes TickValue on every tick. For this purpose, in particular, it pulls data from other pairs. Moreover, Virtual does not count commission and swaps, because it is not really necessary, just like TickValue.

I run everything on custom symbols myself. And there swap is zero. All settlement currencies are equal to the deposit currency. Then it turns out to be a complete match.

In general, the highlighted OnTester is the TS profit without using the best interval, calculated with TickValue = 1, Commission = Swap = 0. That's why it turns out that trading one lot always gives a whole OnTester.