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 = self.BB("EURGBP", 10, 2, resolution=Resolution.Daily)
        self.test_ema = self.EMA("EURGBP", 100)

        
    # 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