Alpaca trading 
/////////////////////////////////////////////////////////////

 Step 1: set up an account at https://alpaca.markets/
 Step 2: pip3 install alpaca-trade-api   # Python package
 Step 3:
 Step 4:
 Step 5:
 Step 6:

/////////////////////////

Test of the January Effect using Excel 
//////////////////////////
If the Efficient Market Hypothesis (EMH) holds, we should not expect many market 
anomalies such as January Effect, Weekday Effect, momentum strategy (buy winners 
and sell losers). However, many researchers and professionals have found that 
returns in January are quite different from other months. 

Question:  Are January returns statistically different from other months?
            
          mean return for January = mean return of none-January  (1)

   Choose about a dozen stocks to test the existence of so-called 
   January effect. A few companies are listed below. Note that S&P500 
    is listed as well. 

 Step 1: For one give ticker (or PERMNO) retrieve return data 
             from CRSP monthly data set 

 Step 2:  Sort those monthly returns into two groups: returns 
             in January and returns in other months. 

 Step 3: For each stock/index, test whether its two means 
             are equal, see the above equation. 

 Step 4: repeat the above procedure for 100 stocks.

 Comments on your results. 

//////////////////////////

SVM model 
/////////////////////////
from sklearn import svm
from sklearn.metrics import classification_report

svm_model = svm.SVC()    # Create the classifier model
svm_model = svm_model.fit(X_train_scaled, y_train)
training_signal_predictions = svm_model.predict(X_train_scaled)
training_signal_predictions[:10]
training_report = classification_report(y_train, training_signal_predictions)
print(training_report)

testing_signal_predictions = svm_model.predict(X_test_scaled)
svm_testing_report = classification_report(y_test, testing_signal_predictions)
print(svm_testing_report)

predictions_df = pd.DataFrame(index=X_test.index)   # Create a new empty predictions DataFrame using code provided below.
predictions_df["predicted_signal"] = testing_signal_predictions
predictions_df["actual_returns"] = trading_df["actual_returns"]
predictions_df["trading_algorithm_returns"] = predictions_df["actual_returns"] * predictions_df["predicted_signal"]
predictions_df.head()

# Calculate and plot the cumulative returns for the `actual_returns` and the `trading_algorithm_returns`
(1 + predictions_df[["actual_returns", "trading_algorithm_returns"]]).cumprod().plot()
/////////////////////////