Skip to Content
Learn Algorithmic Trading
book

Learn Algorithmic Trading

by Sebastien Donadio, Sourav Ghosh
November 2019
Beginner content levelBeginner
394 pages
10h 31m
English
Packt Publishing
Content preview from Learn Algorithmic Trading

Support vector machine

Support vector machine (SVM) is a supervised machine learning method. As previously seen, we can use this method for regression, but also for classification. The principle of this algorithm is to find a hyper plan that separates the data into two classes.

Let's have a look at the following code, that implements the same:

# Fit the modelsvc=SVC()svc.fit(X_train, Y_train)# Forecast valuegoog_data['Predicted_Signal']=svc.predict(X)goog_data['GOOG_Returns']=np.log(goog_data['Close']/                                goog_data['Close'].shift(1))cum_goog_return=calculate_return(goog_data,split_value=len(X_train),symbol='GOOG')cum_strategy_return= calculate_strategy_return(goog_data,split_value=len(X_train))plot_chart(cum_goog_return, cum_strategy_return,symbol='GOOG') ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

High-Frequency Trading: A Practical Guide to Algorithmic Strategies and Trading Systems

High-Frequency Trading: A Practical Guide to Algorithmic Strategies and Trading Systems

Irene Aldridge
Developing High-Frequency Trading Systems

Developing High-Frequency Trading Systems

Sebastien Donadio, Sourav Ghosh, Romain Rossier

Publisher Resources

ISBN: 9781789348347Supplemental Content