Re: Balance Line Stability - Development

P.S.: I will send you some big kudos if you´ll be able to get the Balance line stability working based on R-squared and most important: add it as an optimization goal. Combined with minimum trades in the acceptance criteria, optimizing for Balance line stability will be a KILLER feature for EA Studio :-)

Re: Balance Line Stability - Development

geektrader wrote:

P.S.: I will send you some big kudos if you´ll be able to get the Balance line stability working based on R-squared and most important: add it as an optimization goal. Combined with minimum trades in the acceptance criteria, optimizing for Balance line stability will be a KILLER feature for EA Studio :-)

+1

Re: Balance Line Stability - Development

Now Balance Line stability is added as a search criteria in Generator and Optimizer.

Formula is updated.

Here is what I achieved on EURUSD H1.

https://image-holder.forexsb.com/store/EURUSD-H1-balance-line-stability-99.76.png

29 (edited by geektrader 2019-01-03 20:59:54)

Re: Balance Line Stability - Development

Thank you, sounds good Mr. Popov, I will test this right away and report back! Are you using R squared now from the formula I´ve sent or is it something else?

30 (edited by geektrader 2019-01-03 21:39:51)

Re: Balance Line Stability - Development

Hmm, is the update uploaded already? I´ve refreshed my browser and cleared cache a few times already, but I am seeing the exact same results in balance line stability calculation like before. Although I am seeing the balance line stability as a new goal for the optimizer, so I guess it´s been uploaded. However, see this one which definitely should not have a 98.39 and shows the exact same value for the balance line stability like before your update (posted it here before https://forexsb.com/forum/post/53482/#p53482 picture #2):

https://i.imgur.com/FRGunfz.jpg

So at least in those cases, the formula is giving the exact same results like before the update and hence wrong ones / unlogical ones. What happened?

Re: Balance Line Stability - Development

I studied the R-squared metric and it appeared that I'm using a very similar formula.

The formula you send me can be barely called R-Squared. It is heavily modified ans specialized for the use case.

...

I upload now a new version that zooms better the significant values:

1. Change the range (-1, 1) to (0, 1):

const corrected: number = (1 + correlation) / 2;

2. Zoom the values:

const stability: number = 100 * corrected * corrected * corrected * corrected;

Please reload the program.

32 (edited by geektrader 2019-01-03 21:43:12)

Re: Balance Line Stability - Development

It´s based on R-squared to calculate the correlation though. Thanks, testing right away...

Re: Balance Line Stability - Development

It *seems* to be better, but I have to test a few more. Here is a very odd result though, shows almost 100 for stability, yet is completely bad ;-)
https://i.imgur.com/Go812TD.jpg

Re: Balance Line Stability - Development

This is also odd, why would the first strategy in the list have a higher stability value than the second one? Makes no real sense to me. I think the formula still needs some work, I have never seen such strategies scoring higher in SQ. Maybe follow their formula more close?

https://i.imgur.com/agcOpUR.jpg

Re: Balance Line Stability - Development

I will check carefully if the formula takes into account the last deal.

Please save this example for any case, if I find a mistake.

36 (edited by geektrader 2019-01-03 22:21:52)

Re: Balance Line Stability - Development

OK. I´ve ignored the OOS period in the above cases, of course. Also it might be that the first strategy has no trades at all at first and hence the formula might only count from the first trade which is very late in the first strategy. I think the formula should not be trade-based, but time-based, then I am sure the results would be correct. Or at least it should not ignore if a strategy does not trade for the first half like the first one does. Maybe put a "zero point" / "zero trade" as a starting point in any case, so such strategies will be force to have their first trade right at the start (at least a virtual one for the calculations).

Re: Balance Line Stability - Development

This is the exact case. Good job!

It is very easy to be fixed.

Re: Balance Line Stability - Development

Great :-) Here is another case. I´ve optimized for max stability, the only acceptance criteria was to have at least 1500 trades. As you see, the optimizer found a perfect equity line, but it´s negative. Sure we can stop this by using net profit > 0 as an acceptance criteria, but why not make the stability -99 (a perfect negative equity curve) in that case instead of also +99? Maybe you just should not always "math absolute" the results, but allow a range between -100 (perfect negative equity curve) and +100 (perfect positive equity curve), then we do not need to use additional acceptance criteria and such cases won´t happen.

Before:

https://i.imgur.com/D2PGrVL.jpg

After:

https://i.imgur.com/tbIsImt.jpg

Re: Balance Line Stability - Development

It is correct. You want from the app to make you a linear balance line and it is so good to make one for you.

The stability means exactly stability, not profitability. The max score 100 means that the strategy balance line is close to the straight line. it has absolutely no relation with the direction of the line.

In order to prevent such cases, it was a hard coded requirement for minimum profit of 0.00001. However there were users that very VERY heavy requested to remove it. So I moved it to the Acceptance Criteria and set it to be a default value.

EA Studio does exactly what you want. In that case, you remove the positive profit requirement and the program knows that you don't care for it. 

..

-99 must mean that the balance line is completely opposite to a straight line, what ever shape would be that - a circle !?

40 (edited by geektrader 2019-01-03 23:01:59)

Re: Balance Line Stability - Development

Haha, I meant -100 = a perfect 90 degree downward pointing line, 100 = a perfect 90 degree upward pointing line. But it´s no problem, it´s easily solved by another acceptance criteria indeed.

41 (edited by geektrader 2019-01-03 23:07:41)

Re: Balance Line Stability - Development

Hmm, there is still something wrong. Look at this, 99.58?? I don´t  think so if I see the equity curve... What could be still wrong? Any ideas?

https://i.imgur.com/opTOh7d.jpg

I can send you the strategy JSON if needed, no problem, but I think you´ll lack the history data (though you could take it out of my account, right?)?

Are you possibly truncating / putting a "hard limit" on the amount of trades for the calculations? So that it only calculates the stability on the first 4000 trades (because that is pretty much a straight line indeed) and then stops? Because this strategy has over 7000 trades.... Just an idea why this might happen, as I´ve not seen this happening on strategies with a lower amount of trades (~2000 to ~3000) and it seems to work fine there.

Re: Balance Line Stability - Development

Please try with lower initial account and lot size.
It is completely possible to overload the browser max number.
For sure what I see from the screenshot is that it will overload a 32 bit browser where the maximal number is only 2147483647 ,where the squared profit in your case is  94748842969.

Re: Balance Line Stability - Development

Hmm, but I am on a 64 bit browser, should not happen there?

44 (edited by geektrader 2019-01-03 23:22:20)

Re: Balance Line Stability - Development

1000 starting balance, 0.01 lot size, makes no difference, see:

https://i.imgur.com/USw5GYN.jpg

Must come from another issue then. As I said, with strategies with fewer trades (2000 to 3000), it´s all right. Are you sure the formula is not having an issue with the amount of trades and is "cutting off" after a few thousand trades? I mean I think we can agree that this strategy should not have a 99.58 for the stability, right?

45 (edited by geektrader 2019-01-03 23:25:58)

Re: Balance Line Stability - Development

I´ve just added a "shorts only" extra indicator to reduce the trades to 3900, yet the issue is still there and the resulting stabilty number is exactly the same too, something is wrong with the formula I bet, whatever it is:

https://i.imgur.com/cjW0l5Z.jpg

Re: Balance Line Stability - Development

And now I´ve reduced the data-horizon by 10 years to 20 years total, resulting in 2700 trades, but still getting > 99 for stability although that clearly cannot be the case if looking at the equity curve:

https://i.imgur.com/EhonhuW.jpg

Re: Balance Line Stability - Development

And I did one more experiment, I´ve further optimized the above strategy with the Optimizer, using Balance line stability as the optimization goal, it increased the stability to 99.54 now, but look the equity line, it´s even worse than before (in relation to following a straight line), yet it has an even higher stability number? The formula seems to have a serious issue somewhere still....

https://i.imgur.com/hcWdOn8.jpg

Do you want me to send you the strategy?

Re: Balance Line Stability - Development

Hmm, I´ve refreshed my browser and cleared cache completely, just to make sure I am using the latest version. I am, the results are the same as posted above. However, I now notice that I am also seeing the issue with my other strategies again. This seems to have started again after you´ve uploaded the fix about the "first virtual trade" that you´ve fixed. Before, it was OK. Very strange, but now most Balance line stability values that EA Studio shows make no sense anymore (just like before in my first posts on page #1).

Re: Balance Line Stability - Development

I adapted the formula you send me. It looks good in general. However it shows very low result for the OOS part.

Please test it and report.

I'll make a beta server tomorrow in order to make the app easier for testing.

50 (edited by geektrader 2019-01-03 23:47:17)

Re: Balance Line Stability - Development

Odd, because I´ve rebuilt this strategy in SQ and I get a 70 (0.70) result there for this one, which seems logical and correct. But EA Studio shows 99.54 for it:

https://i.imgur.com/hcWdOn8.jpg

Do you agree that this one should not show a 99.54 for stabilty? I mean it does not follow a straight line AT ALL.

Test server sounds good. If you´d want, I could also have a look at the JS code directly and help testing on my own / together with you too. Not exactly sure how open you are to that idea.