Overall Statistics
from QuantConnect.Data import SubscriptionDataSource
from QuantConnect.Python import PythonData
from datetime import date, timedelta, datetime
from decimal import Decimal

class loadCustomData(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2017, 1, 2)
        self.SetEndDate(2017, 1, 3)
        ### Import the custom data 
        self.AddData(XYZ, "XYZ", Resolution.Minute)

    def OnData(self, data):
        if not (data.ContainsKey("XYZ")): return
        ### Print price to log:
        self.Log('data["XYZ"].Price : ' + str(data["XYZ"].Price))
        if not self.Portfolio['XYZ'].Invested:
class XYZ(PythonData):
    "Import data from google cloud"
    def GetSource(self, config, date, isLiveMode):
        return SubscriptionDataSource("https://docs.google.com/spreadsheets/d/e/2PACX-1vReHX1zAOU8Kgylr1npfZjxw8b52vXA5EH5MpBkFqm2-eN1GVXYi7ei8T_a1xiJReDNulRerDmqpg9L/pub?output=csv", SubscriptionTransportMedium.RemoteFile)
    def Reader(self, config, line, date, isLiveMode):
        if not (line.strip() and line[0].isdigit()): return None
        index = XYZ()
        index.Symbol = config.Symbol
            data = line.split(',')
            ### Date format set for minute resolutino
            index.Time = datetime.strptime(data[6], "%Y-%m-%d %H:%M:%S")
            ### Get close price
            index.Value = Decimal(data[4])
            return None
        return index