Машинное обучение в трейдинге: теория, модели, практика и алготорговля - страница 1063

 
Maxim Dmitrievsky:

All right, but need to implement it correctly: save best model and coefficients for predictors, for next usage

also different methods of gmdh - fast genetic selection or brute force (I think 1-st)

Also, in this new library you can add multiple agents with different predictors and different settings, the result will be averaged over all agents

To save the best model you need to iterate the whole thing to target a specific value of "Sharp ratio" and "Recovery factor". Until it achieves the required optimisation results, don't trade. I have already implemented it in your previous version. If you want sample code, I can give.

Yes, of course, the fast genetic algorithm. But as I mentioned above don't place trade until it achieves the required results set in the input settings and hence, it doesn't matter.

Let me explore the possibilities of this new library and I will give you feedback.

 
Maxim Dmitrievsky:

In this version I check classification (or logloss) errors on test subset, and choose the best one. This model I save. I think it works well, but current kernel is sucks 

And this function choose the best model on transformed predictors

Ok, but how will it repeat the iteration? I mean is it a one time process or is it going to repeat itself after every candle or every hour etc?

That is the most important part.

I am using a third party software developed by my own to iterate the whole thing since I don't know how to do it in MQL5. I mean I was using it in your previous version to check the "sharp ratio" after every optimisation completion.

Have you done anything similar to iterate the whole process continuously after a certain period of time?

 
FxTrader562:

But how will it repeat the iteration? I mean is it a one time process or is it going to repeat itself after every candle or every hour etc?

That is the most important part.

I am using a third party software developed by my own to iterate the whole thing since I don't know how to do it in MQL5.

this 1 iteration process, in tester. Then in that functiion he transform predictors iteratively and learn the models

I have another version for optomisator, but in my experience 1 iteration also good here

 
FxTrader562:

Have you done anything similar to iterate the whole process continuously after a certain period of time?

not yet

if we have a good model - it will work days and weeks, so auto-optimisation is not a priority task
 
Maxim Dmitrievsky:

this 1 iteration process, in tester. Then in that functiion he transform predictors iteratively and learn the models

I have another version for optomisator, but in my experience 1 iteration also good here

But I don't think that one model can work always without optimization. Especially, when the market changes the best model can fail terribly even after a large value of sharp ratio and other factors..

 
FxTrader562:

Then I think it will be okay if you are continuously optimizing.


By the way, this is the source code what I am talking about:

input string OptimizationParameterCheckSettings="===Settings for saved Optimization paramaters===";

input bool OptimizationParameterCheck=true;

input double SharpRatioRequired=0.3;


Add this code inside tester:

      filehnd=FileOpen("SharpRatio_"+_Symbol+(string)_Period+".txt",FILE_READ|FILE_WRITE|FILE_CSV|FILE_ANSI|FILE_COMMON);//--To save the SharpRatio of the last run

      double SharpRatio=NormalizeDouble(TesterStatistics(STAT_SHARPE_RATIO),2);

      FileWrite(filehnd,SharpRatio);

      FileClose(filehnd);


Next, inside start function:

if(SharpRatioLastRun<SharpRatioRequired)

{

Comment("Current trading policy doesn't meet the trading requirement as per last optimization results....So trading has been stoped for sometime");

return;

}


nice method, thanks!

 
Maxim Dmitrievsky:

nice method, thanks!

Ok, but I will repeat that you should seriously consider to add some form of continuous optimization, otherwise, it is going to fail. Because as I said earlier I tried each and every combination of the settings as well as different indicators and multiple timeframes and nothing worked perfectly so far.....

But when I continuously iterate, then it used to work sometimes good. By the way, I have the solution for mine. But I don't like that method of doing it since it should be done by MQL5 and I don't know how to do it in MQL5.

 
FxTrader562:

Ok, but I will repeat that you should seriously consider to add some form of continuous optimization, otherwise, it is going to fail. Because as I said earlier I tried each and every combination of the settings as well as different indicators and multiple timeframes and nothing worked perfectly so far.....

But when I continuously iterate, then it used to work sometimes good.

Because models still sucks ^) with big errors, need models that work longer

for example 2 months learning and 1 week trade
 
Maxim Dmitrievsky :

Because models still sucks ^) with big errors, need models that work longer

for example 2 months learning and 1 week trade

You may be correct, but I don't think that any such models will ever be discovered by RDF which an work even for one complete day until we can do unlimited random candle simulations similar to "ALPHA ZERO" algo.

Because markets change almost every hour and one model will terribly fail if suddenly a news event will occur or if the market will change it's behaviour for some reason. But if we have done millions of candle simulations, then probably the system can recover with minimal loss upon market change and can quickly recover the loss afterwards. That seems to be possible. 

I will try both your method of model selection and my method of candle simulation to see how everything goes:))

By the way, I tried 1 days training,5 days training etc and it failed on next day:))))))))))))))))

So one model may not work..though I may be wrong...

 

Also, I have one more request Maxim...

When you publish your article, please try to comment the code as much as possible so that it will be quick and easy for others to understand the code so that we can progress faster..

Otherwise, if it will take a long time for me to understand the code, then it will take even more time to modify it.

So I request you to add as many comments and explanations of the code possible. For now I will try to understand it quickly and will ask you if I don't understand anything:))

Причина обращения: