So I'm new to Quantconnect and I'm trying to use LEAN on my my own computer to import some of my own data, I put it in the correct directory and named it the correct name, and all I did was change acouple variables into the starter code
from clr import AddReference
AddReference("System")
AddReference("QuantConnect.Algorithm")
AddReference("QuantConnect.Common")
from System import *
from QuantConnect import *
from QuantConnect.Algorithm import *
import numpy as np
class WorkBench(QCAlgorithm):
'''Basic template algorithm simply initializes the date range and cash'''
def Initialize(self):
'''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''
self.SetStartDate(2016,01,01) #Set Start Date
self.SetEndDate(2016,01,01) #Set End Date
self.SetCash(100000) #Set Strategy Cash
# Find more symbols here: http://quantconnect.com/data
self.AddEquity("FUT", Resolution.Second)
print "numpy test: print np.pi" , np.pi
def OnData(self, data):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
Arguments:
data: Slice object keyed by symbol containing the stock data
'''
if not self.Portfolio.Invested:
self.SetHoldings("FUT", 1)
and in the command line its giving me this error
20170831 12:43:11 Error:: DefaultDataProvider.Fetch(): The specified file was not found: ../../../Data/equity\usa\minute\fut\20151231_trade.zip
So I dont understand why its looking in the minute folder if I'm requesting second resolution, I can switch it pretty easily, but I feel like that shows there some other underlying problem.
In addition to this it looks like its trying to get SPY data as well, in the command line
20170831 12:43:12 Trace:: BrokerageModelSecurityInitializer.Initialize(): Unable to seed security: SPY
This happens after it prints out pi, which is odd because that implies that it happens after initialization, which I dont understand either, can someone please help.
Thanks
Michael Manus
I think it needs spy as benchmark (for backtest).
What kind of equity is FUT?
Ethan Trokie
FUT is just a random name I made up, its actually a future, but it just has time, open, high, low, close, volume, just like equity, so I thought it would be easier to import it so it looks like an equity.
Jared Broad
Hi Ethan Trokie - we "seed" the security with the last available price when the algorithm starts. To make this happen quickly we use minute data files. Your algorithm should run fine without this you'll just have $0 price when your algorithm starts up.
Setting the dates so close; and on the 1st Jan will also result in no tradable dates as the market is closed at that time.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Ethan Trokie
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!