Hi, I still don't understand if it's possible to develop a machine learning strategy in researchmode, with a non OOP Python pipeline (Sklearn, pandas ecc.), save the model (model.predict(X_test)) and then load it in the Main strategy environment for scheduled training e backtest/live trading purposes.For example this is a random forest basic strategy pipeline in Jupyter and historical/live FXCM data, i'm actually not interestedin results, it's just a test for an end to end implementation:`def strategy(forex,time,start_years):`

I'm stuck on this point: regressor.predict(X_test)

pair = forex

period = time

end = dt.datetime.now()

years = timedelta(days=365)

start = end - (years*start_years)

df = con.get_candles(pair, period=period, start=start, end=end)

df = df.drop(['bidopen','bidhigh','bidlow','askopen','askclose','askhigh','asklow','tickqty'], axis=1)

df["bidclose"] = df["bidclose"].pct_change()

df = df.dropna()

df = df.rename(columns = {'bidclose': 'returns'})

df["y"] = df.iloc[:, 0].shift(-1).fillna(method='ffill')

X = df.iloc[:, 0].values.reshape(-1,1)

y = df.iloc[:, 1]

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.4, random_state=0)

regressor = RandomForestRegressor(n_estimators=50, random_state=0)

model = regressor.fit(X_train, y_train)

y_pred = regressor.predict(X_test)

print('Mean Absolute Error:', metrics.mean_absolute_error(y_test, y_pred))

print('Mean Squared Error:', metrics.mean_squared_error(y_test, y_pred))

print('Root Mean Squared Error:', np.sqrt(metrics.mean_squared_error(y_test, y_pred

return

strategy('NZD/USD','H1',1)

From there to a fully functional strategy ready for backtesting and live trading...which are the fundamental passages? I copy/paste this code in research environment adapting data acquisition, then?

Thank you very much