Discussion of article "Advanced resampling and selection of CatBoost models by brute-force method" - page 15

 

Hi,

Thanks for the article. I tried it but somehow I dont get the nice equity curve (even for the training period) in MT5 backtest as it is shown in python (see below). When I backtest with your EURUSD EA from your article it works. What can I solve the error?


 
konorti:

Hi,

Thanks for the article. I tried it but somehow I dont get the nice equity curve (even for the training period) in MT5 backtest as it is shown in python (see below). When I backtest with your EURUSD EA from your article it works. What can I solve the error?

Hi, maybe problem with MARKUP for the custom tester for usdjpy, so results are different

 

Added a new method of searching for extrema (chart markup), like a zigzag pattern

from scipy.signal import argrelextrema

def add_peaks(dataset, order, plot=False):
    ilocs_min = argrelextrema(dataset.close.values,
                              np.less_equal, order=order)[0]
    ilocs_max = argrelextrema(dataset.close.values,
                              np.greater_equal, order=order)[0]
    dataset['low_lbl'] = False
    dataset['high_lbl'] = False
    dataset.loc[dataset.iloc[ilocs_min].index, 'low_lbl'] = True
    dataset.loc[dataset.iloc[ilocs_max].index, 'high_lbl'] = True

    if(plot):
        dataset.close.plot(figsize=(15, 5), alpha=.3)
        dataset[dataset['high_lbl']].close.plot(
            style='.', lw=10, color='red', marker="v")
        dataset[dataset['low_lbl']].close.plot(
            style='.', lw=10, color='green', marker="^")
        plt.show()

    conditions = [
        (dataset['low_lbl'] == False) & (dataset['high_lbl'] == False),
        dataset['low_lbl'] == True,
        dataset['high_lbl'] == True
    ]
    choices = [np.nan, 0, 1]
    dataset['labels'] = np.select(conditions, choices)
    dataset = dataset.drop(['low_lbl', 'high_lbl'], axis = 1)
    dataset = dataset.fillna(method='ffill')
    return dataset.dropna()

pr = add_peaks(pr, 15, plot=True)

By playing with the parameter you can adjust the frequency of trades. Tests have shown that marking by extrema is not the best idea. The approach from the article works better.

 
Maxim Dmitrievsky:

Hi, maybe problem with MARKUP for the custom tester for usdjpy, so results are different

Thanks. I tried with different MARKUPs (higher & lower) and also different timeframes but not really successful. I saw some good results on 4H timeframe/USDJPY but with other forex pairs not really and I tried to redo the test sevaral times without success. Is it possible to somehow filter the trades so the EA is not always in the market but just with strong signals?
 

Hi Maxim,

The current article is okay, but limited computing power and curve fitting are biggest concerns to such traditional methods and hence, usually I stay away from testing such approaches.

Are you interested to write an article on implementation of "MuZero" from DeepMind in Forex?

https://deepmind.com/blog/article/muzero-mastering-go-chess-shogi-and-atari-without-rules

https://medium.com/applied-data-science/how-to-build-your-own-muzero-in-python-f77d5718061a

I am asking this to you since I am a basic level MQL5 programmer and it can take a long time for me to write from scratch which you can probably do easily.

Please let me know your thoughts.


I will define what to write for the following in forex coding and can you convert it to MQL5 code:

  • The  value: how good is the current position?
  • The  policy: which action is the best to take?
  • The  reward: how good was the last action?

Thanks.

MuZero: Mastering Go, chess, shogi and Atari without rules
MuZero: Mastering Go, chess, shogi and Atari without rules
  • deepmind.com
In 2016, we introduced AlphaGo, the first artificial intelligence (AI) program to defeat humans at the ancient game of Go. Two years later, its successor - AlphaZero - learned from scratch to master Go, chess and shogi. Now, in a paper in the journal Nature, we describe MuZero, a significant step forward in the pursuit of general-purpose...
 
Maxim, it would be nice to do a signal on the article, seems like good results.
 
elibrarius:
Maxim, it would be good to make a signal on the article, it seems to have good results.

There are more advanced methods already, in terms of data preparation, I am working with them.

Monitoring every article is not an option.

It's more for scientific and cognitive purposes.

 
when I change the train start and stop datetime, the model backtests result is bad, what can I do to improve model performance?
 
I spend a lot time,finally I get what you are doing.Because the label of the ml algorithm is  imbalance,you use a GaussMixtureModel to simulate the price born,then sampled from the model,then you can train a better ml algorithm 
 
In regards to the article, although I didn't read it, I thought it was very powerful. So I decided to take a moment to give some advice. Firstly, the data source in this market is only part of the chips in the market, or a small portion of the chips, it is the majority of the chips that traders have on hand that can determine the direction of the market, so it is difficult to achieve the results we expect from the data collection, relying on what methodology and approach to optimise what may be just a fit to the past market. Secondly, this market for a short period of time it is not random, as an example, when there are only 2 multi-side traders and 2 short-side traders, one short-side N price listed for sale, the other short-side N-1 price for sale. A multi party N-1 buy, the current price of N, assuming that another multi party N price buy, theoretically on the price should be N, in fact, the empty N no single, the aggregation mechanism will go to N-1 to find a deal, so the current price of N-1, is probably so mean. So N and N-1, N+1, etc. are all related and not completely random, so data optimisation can be better from momentum. Finally, whether it is EA or manual trading, it is difficult to make money from the market steadily, because if it is stable then the wealth will inevitably be transferred to a certain market participant, and this market will cease to exist. So investment is to invest in risk, harvest risk process, too concerned about the stability of the possible losses, I do not object to some people in the market transactions found a certain law, the equivalent of the market BUG realised wealth only, in fact, the market itself is also in the process of self-improvement because of the complexity of the participants, but the gold is not red, no one is perfect. The direction of intelligent trading is theoretically the process of constantly looking for market bugs, this BUG is only a small number of people to use, with more people on the failure. I hope my comment can be a reference for you. vx tiger54088 pass by