Machine learning in trading: theory, models, practice and algo-trading - page 1140

 

Greetings to some scientific circles on AI in trading)))

I hope you joined your efforts to implement the project "Give me 100% annual returns with a probability of 10 to 1 !!! " ???

Is there a prototype of the Expert Advisor already? Or what is the correct name for such a machine ...))

 
pantural:

What can I tell you gentlemen...

These are the side effects of using black boxes, foreign libraries, etc.

I can only offer you to publish equity in CSV of your research and I will tell you what is the correct Sharp Ratio of your models, you can calculate the code yourself attached (python)


If you send me equity or PnL, I will figure out what the problem is, I can guess that if PnL is used "unloaded" that is, with gaps between trades (which is certainly not true), hence the scaling, I would bet 100$ that this is the problem.

First, the formulas can be found in the article Mathematics in Trading. Valuation of Trading Results.

Second, this article shows that Sharpe is calculated based on the results of trades (trades), not on fluctuations in equity.

 
Rashid Umarov:

First, the formulas can be found in the article Mathematics in Trading. Evaluation of Trading Results.

Secondly, the article shows that the Sharp is calculated on the basis of transactions (trades) results, not on equity fluctuations.

I completely forgot about this article, I think that some of the information can be added to the HELP in order to make the calculation more understandable to reproduce it.

It turns out that the Sharpe Ratio depends on the initial deposit, which does not allow making a correct comparison of the potential of different TS. I.e. it's necessary to define the required value of the initial deposit.

 
Aleksey Vyazmikin:

It turns out that the Sharpe Ratio depends on the initial deposit and cannot be used for the correct comparison of the potential of different TS.

It does not depend on it, because it is calculated as Ki=balance_after_fixing_profit_loss/balance_before_fixing_result after fixing the result of the i-th trade.

The Kn row contains values in the neighborhood of 1:

  • If the i-th trade is profitable, then Ki>1.
  • If the i-th trade is losing, Ki<1.
 
Aleksey Vyazmikin:

I give a minute-by-minute variant, and I attach the tester's trading report.

However I have improved the indicators a little.

The Sharpe Ratio is now 0.29.

I took your report, copied trades from it and made calculation in Excel based on them. I attach the file

As you can see, in the test report, the Sharpe ratio is calculated correctly.


 
pantural:

real Sharp ratio = ~3.79

The error of those who made the algorithm to calculate your numbers is obvious. They stupidly forgot to scale the ratio of returnee to variation by the square root of the series length

def SharpRatio(PnL):

PnL = [x for x in PnL if abs(x) > 0]

ret = sum(PnL) / len(PnL)

var = ((sum([(x - ret) ** 2 for x in PnL]) / len(PnL)) ** 0.5

return len(PnL) ** 0.5 * ret / var


PS: SR=3.79 is very optimistic, of course if it is not a sweat (to some extent) and tested correctly

In general, it is desirable to understand the meaning of parameters before taking them on faith. Having received such value you should have thought about it and started to look for error in your calculations.

Since the Sharpe Ratio is greater than 3, this is a 100% earning strategy and there is more than 99.99% probability of profit. If the PnL distribution is normal, of course.

 
Konstantin Nikitin:

For my observations I haven't managed to increase Sharpe Ratio more than 1. I haven't seen my opponent's accounts/charts with higher values. Although I may be wrong.

And that is not surprising. One is a very good value for the Sharpe Ratio. On another topic - optimizing the strategy using the balance graph and comparing the results with the "Balance + max Sharpe Ratio" criterion

 

How do I calculate the Sharpe Ratio for a single trade?

 
Renat Akhtyamov:

How do I calculate the Sharpe Ratio for one trade?

You've got to be kidding me. I'm writing here, and they say to me - all for nothing, let's continue to talk.

 
Rashid Umarov:

You've got to be kidding me. I'm writing here, I'm getting all raspy, and they say to me - all for nothing, let's talk further.

I'm sorry, I didn't notice the attachment.
Reason: