Overall Statistics
import numpy as np

from datetime import datetime, timedelta

class BasicTemplateAlgorithm(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2018,1,1)  #Set Start Date
        self.SetEndDate(2018,2,1)    #Set End Date
        self.SetCash(20000)           #Set Strategy Cash
        self.AddForex("EURGBP", Resolution.Minute, Market.Oanda, leverage=30)
        
        # Consolidate minute price to daily price
        daily_consolidator = QuoteBarConsolidator(timedelta(hours=24))
        daily_consolidator.DataConsolidated += self.OnDataConsolidated
        self.SubscriptionManager.AddConsolidator("EURGBP", daily_consolidator)
        
        # Set up Bollinger Band
        self.bb_20 = BollingerBands(10, 2, MovingAverageType.Simple)
        self.RegisterIndicator("EURGBP", self.bb_20, daily_consolidator)
        self.test_ema = ExponentialMovingAverage(100)
        self.RegisterIndicator("EURGBP", self.test_ema, daily_consolidator)

        
    # Receive daily data
    def OnDataConsolidated(self, sender, bar):
        if not self.bb_20.IsReady:
            self.Log("bb is not ready")
            self.Quit()
        else:
            self.Debug("{}".format(self.bb_20.MiddleBand))

        
    # Receive minute data
    def OnData(self, data):
        pass