Libraries: BestInterval - page 22

 
fxsaber:

It will work properly if you make MT4Orders enclode before BestInterval.

The library concerns only trading operations and their history. Moreover, it can work in parallel with SB and others.

So indicators do not affect it in any way.

I see, thanks, I will try it.
 
fxsaber:

BestInterval on netting only in one specific case (made for myself) takes the trading history correctly.

What is this case, if it is not a secret? Maybe I can use something similar without shamanism.

 
traveller00:

What's the case, if it's not a secret? I might be able to use something similar without any shamanism.

A shapeshifting TC.

 
fxsaber:

I can't answer that. I don't know yet.

To say I'm pleased is clearly an understatement..... BestInterval is awesome now. And the changes are minimal. As always, an example.


Here's a 24-hour pass.


We apply the classic BestInterval.

Profit = 8018.00 = 8018.00 + 0.00 (0.00%) - Amount of Delete Intervals = 0 (2019.09.14 - 2019.12.04)
00:00:00 - 23:59:59 : Profit = 8018.00 (100.00%), Total = 739 (73.34%), PF = 1.44, Mean = 10.85, DD = 1317.00, RF = 6.09
SUMMARY: 00:00:00 - 23:59:59 : Profit = 8018.00 (100.00%), Total = 739 (73.34%), PF = 1.44, Mean = 10.85, DD = 1317.00, RF = 6.09

Profit = 10721.00 = 8018.00 + 2703.00 (33.71%) - Amount of Delete Intervals = 1 (2019.09.14 - 2019.12.04), 13:00 - 08:00, CountHours = 18
00:00:00 - 08:03:48 : Profit = 3278.00 (30.58%), Total = 161 (79.50%), PF = 2.21, Mean = 20.36, DD = 518.00, RF = 6.33
13:07:59 - 23:59:59 : Profit = 7443.00 (69.42%), Total = 389 (74.55%), PF = 2.14, Mean = 19.13, DD = 417.00, RF = 17.85
SUMMARY: 00:00:00 - 23:59:59 : Profit = 10721.00 (100.00%), Total = 550 (76.00%), PF = 2.16, Mean = 19.49, DD = 536.00, RF = 20.00

We can see that the profit has increased by one third, and other indicators have become better.


But we wanted flexibility. And here it is.

Profit = 8018.00 = 8018.00 + 0.00 (0.00%) - Amount of Delete Intervals = 0 (2019.09.14 - 2019.12.04)
00:00:00 - 23:59:59 : Profit = 8018.00 (100.00%), Total = 739 (73.34%), PF = 1.44, Mean = 10.85, DD = 1317.00, RF = 6.09
SUMMARY: 00:00:00 - 23:59:59 : Profit = 8018.00 (100.00%), Total = 739 (73.34%), PF = 1.44, Mean = 10.85, DD = 1317.00, RF = 6.09

Profit = 4868.00 = 8018.00 + -3150.00 (-39.29%) - Amount of Delete Intervals = 1 (2019.09.14 - 2019.12.04), 20:00 - 01:00, CountHours = 4
00:00:00 - 01:31:54 : Profit = 1067.00 (21.92%), Total = 32 (87.50%), PF = 4.63, Mean = 33.34, DD = 177.00, RF = 6.03
19:29:54 - 23:59:59 : Profit = 3801.00 (78.08%), Total = 118 (83.90%), PF = 5.53, Mean = 32.21, DD = 249.00, RF = 15.27
SUMMARY: 00:00:00 - 23:59:59 : Profit = 4868.00 (100.00%), Total = 150 (84.67%), PF = 5.29, Mean = 32.45, DD = 310.00, RF = 15.70


Profit didn't increase, it decreased! But look at the other indicators. Instead of finding the interval with the highest profit and probability of fitting, a much narrower interval was found, but much tastier than the classic.


The innovation is added like this

#define  BESTINTERVAL_SLIPPAGE // Creating an artificial filter to calculate BestInterval.


The quality of market pattern research is now very much improved. Significant implications for multi-tester work.

[Deleted]  
So 150 trades is a much more likely fit, no?
 
trader_number_one:
So 150 trades is a much more likely fit, no?

Thenumber of trades depends on the length of the interval.

 

Sometimes the deletion of intervals gets screwed up. Namely

const double Profit = dDeals[i].Profit + SlipPerLot * dDeals[i].Lots;

produces NaN because dDeals[i].Lots equals NaN at i=0.

It seems that the legs grow from the int Set( const DEAL &dDeals[] ) function where the Lots field is not filled when Amount=0. Or is it more correct to say that Lots is not filled in void ToNull( void )?

But in any case, the bug is very unpleasant, rarely occurring and not easy to debug.

 
traveller00:

But in any case the bug is very unpleasant, rarely manifested and not easy to debug.

Yes, I was happy to post it without checking it properly. I'll check it out, thanks.

 
I corrected the int Set( const DEAL &dDeals[] ) function by filling Lots with zero. If I've fixed it wrong or missed something else, please write me back. Thanks.
 
traveller00:
I have corrected the int Set( const DEAL &dDeals[] ) function by filling Lots with zero. If I've fixed it wrong or missed something else, please write me back. Thanks.

So far I have done only this

        const double Profit = dDeals[i].Profit ? dDeals[i].Profit + SlipPerLot * dDeals[i].Lots : 0;

The rest does not need to be corrected for Lots. But there are errors related to another (old). Need to be corrected.