Discussion of article "Metamodels in machine learning and trading: Original timing of trading orders" - page 11
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
There probably meant that the attributes and labels are built through functions, so automatically.
Probably.
When applied on new data, the already trained model is used, you don't need to delete anything.
And when initialising the start of training, why delete it? I don't cling to words, I just don't understand - we did markup once at the beginning, and then we markup again immediately..... I don't understand this point.
If you want the same - make min and max trade duration the same, min=max
Nah, I just want to try my sampling, and to do that I need to understand what needs to be removed there.
Probably.
And when initialising the start of training, why delete it? I don't cling to words, I just don't understand - we did markup once at the beginning, and then we do markup again right away.... I don't understand this point.
Nah, I just want to try my sampling, and to do that I need to understand what needs to be removed there.
H.y. if there is interest, I can roll out other variants of more "clear" and simple realisations. Because this one is a bit difficult to understand. There are a lot of assumptions here, you can get confused.
H.y. if there is interest, I can roll out other variants of more "clear" and simple realisations. Because this one is a bit difficult to understand. There are a lot of assumptions here, you can get confused.
I am interested in any code examples with little description, because I don't understand python code very well yet.
I'm interested in any code samples with little description, because I don't understand python code very well yet.
Python is very simple. Literally a couple of "Python for Complex Problems" books - it covers using basic packages like numpy, pandas, sklearn. And Mark Lutz - Learning Python, Volume 1. The 2nd one is about classes, don't need much.
Thanks for the recommendation. Python may be easy, but my memory has become bad - so it's hard to learn new things.
Is the column "close" after creating a sample with two targets involved somewhere else, or it can be filled with zeros?
In general, I have data in this format in a csv file
Accordingly, I make them look as described in the article through this code
# Загрузите данные из файлов Load_train_data = pd.read_csv('E:\\FX\\MT5_CB\\MQL5\\Files\\Catboost_Tester_M02_104_SMO\\Setup\\train.csv',sep=';') # Сохранили предикторы train_data = Load_train_data.loc[:, :'iVolumes_B0_S15_D1'] # Сохранили значения целевой train_labels = Load_train_data['Target_100'] # Преобразование столбца 'Time' в формат datetime Load_train_data['Time'] = pd.to_datetime(Load_train_data['Time'], format='%Y.%m.%d %H:%M:%S') # Преобразование обратно в строку с нужным форматом #Load_train_data['Time'] = Load_train_data['Time'].dt.strftime('%Y-%m-%d %H:%M:%S') # Сохранили значение столбца train_taime = Load_train_data['Time'] # Вывод результата print(train_taime) # Создали новый DataFrame объединением столбцов combined_data = pd.concat([train_taime, train_data, train_labels], axis=1) # Добавили новый столбец "close" после "train_taime" со значениями "1.1" combined_data.insert(combined_data.columns.get_loc('Time') + 1, 'close', 1.1) # Переименовали столбец "Target_100" в "labels" combined_data.rename(columns={'Target_100': 'labels'}, inplace=True) # Добавили столбец с данными из train_labels combined_data['meta_labels'] = train_labels pr = combined_data # Вывод результата print(combined_data)Prints like this
Next, I comment the functions in your year
I get an error
Traceback (most recent call last): File "F:/FX/Python/meta_modeling_Viborka.py", line 386, in <module> res.append(brute_force(pr[pr.columns[1:]], bad_samples_fraction=0.5)) File "F:/FX/Python/meta_modeling_Viborka.py", line 128, in brute_force X = X[X.index >= START_DATE] File "C:\Program Files\Python38\lib\site-packages\pandas\core\ops\common.py", line 81, in new_method return method(self, other) File "C:\Program Files\Python38\lib\site-packages\pandas\core\arraylike.py", line 60, in __ge__ return self._cmp_method(other, operator.ge) File "C:\Program Files\Python38\lib\site-packages\pandas\core\indexes\range.py", line 964, in _cmp_method return super()._cmp_method(other, op) File "C:\Program Files\Python38\lib\site-packages\pandas\core\indexes\base.py", line 6783, in _cmp_method result = ops.comparison_op(self._values, other, op) File "C:\Program Files\Python38\lib\site-packages\pandas\core\ops\array_ops.py", line 296, in comparison_op res_values = _na_arithmetic_op(lvalues, rvalues, op, is_cmp=True) File "C:\Program Files\Python38\lib\site-packages\pandas\core\ops\array_ops.py", line 171, in _na_arithmetic_op result = func(left, right) File "C:\Program Files\Python38\lib\site-packages\pandas\core\computation\expressions.py", line 239, in evaluate return _evaluate(op, op_str, a, b) # type: ignore[misc] File "C:\Program Files\Python38\lib\site-packages\pandas\core\computation\expressions.py", line 70, in _evaluate_standard return op(a, b) TypeError: '>=' not supported between instances of 'int' and 'datetime.datetime' >>>I want to test it, but I can't :(
TypeError: '>=' not supported between instances of 'int' and 'datetime.datetime'
The first thing I noticed is that you have the wrong dataframe indexes, it should be datetime, i.e. the time column should be indexed
The first thing I noticed is that you have the wrong dataframe indexes, it should be datetime, that is, the time column should be indexed
And how can an idex value (0,1,2) be compared to a calendar date?