Closed Shine119 closed 6 years ago
I didn't include the "SBUX.csv" data which is unfortunately causing a lot of confusion because I use it in the README. I will update this soon. For now, the example data is called "data.csv" and the features are called "X1" and X2". Please update those in your example and it should run.
Thanks for your reply. Yep, I did use data.csv and X1, X2 as features but all the statistics results are zero.
On Sat, Oct 13, 2018 at 10:48 PM anfederico notifications@github.com wrote:
I didn't include the "SBUX.csv" data which is unfortunately causing a lot of confusing because I use it in the README. I will update this soon. For now, the example data is called "data.csv" and the features are called "X1" and X2". Please update those in your example and it should run.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/anfederico/Clairvoyant/issues/29#issuecomment-429547955, or mute the thread https://github.com/notifications/unsubscribe-auth/AQwbB0QdjJKcbYGN8A7hf84DZfJbD_poks5ukf1JgaJpZM4XY1l4 .
Thanks for the responce. I did use data.csv and rename it to SBUX.csv but when I ran the code its giving an error of "IndexError: single positional indexer is out-of-bounds". I am geting this error at line" backtest.start(data, kernel='rbf', C=1, gamma=10)"
The test data only has 322 data points, try:
trainStart = 0 # Start of training period
trainEnd = 200 # End of training period
testStart = 201 # Start of testing period
testEnd = 321 # End of testing period
Hi, I install all the required libraries for the execution of following code: from clairvoyant.engine import Backtest import pandas as pd
features = ["EMA", "SSO"] # Financial indicators of choice trainStart = 0 # Start of training period trainEnd = 700 # End of training period testStart = 701 # Start of testing period testEnd = 1000 # End of testing period buyThreshold = 0.65 # Confidence threshold for predicting buy (default = 0.65) sellThreshold = 0.65 # Confidence threshold for predicting sell (default = 0.65) continuedTraining = False # Continue training during testing period? (default = false)
Initialize backtester
backtest = Backtest(features, trainStart, trainEnd, testStart, testEnd, buyThreshold, sellThreshold, continuedTraining)
A little bit of pre-processing
data = pd.read_csv("SBUX.csv", date_parser=['date']) data = data.round(3)
Start backtesting and optionally modify SVC parameters
Available paramaters can be found at: http://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html
backtest.start(data, kernel='rbf', C=1, gamma=10) backtest.conditions() backtest.statistics()
backtest.visualize('SBUX')
I got an error at line "backtest.start(data, kernel='rbf', C=1.0, gamma=10)". It says that TypeError: 'str' object cannot be interpreted as an integer, and KeyError: 'EMA' I checked the clairvoyant.engine for the solution but I don't know why this happens.