Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Probabilistic Sharpe Ratio
0%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
1.16
Tracking Error
0.122
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
from AlgorithmImports import *

ALGO_TIMEZONE = TimeZones.NewYork

class MyAlgo(QCAlgorithm):

    def Initialize(self):
        self.SetTimeZone(ALGO_TIMEZONE)
        self.SetStartDate(2022, 9, 12)
        self.SetEndDate(2022, 10, 5)
        self.SetCash(10000)

        self.symbol = self.AddForex("EURUSD", Resolution.Minute, Market.Oanda).Symbol

        self.SetBenchmark(self.symbol)

        self.Log(f"""
        Algo timezone: {ALGO_TIMEZONE} | 
        Exchange timezone: {self.Securities[self.symbol].Exchange.Hours.TimeZone} | 
        Data timezone: {self.MarketHoursDatabase.GetDataTimeZone(Market.Oanda, self.symbol, SecurityType.Forex)}
        """)

        self.consolidator = QuoteBarConsolidator(60*25)
        self.Schedule.On(
            self.DateRules.EveryDay(self.symbol),
            self.TimeRules.At(17, 1, TimeZones.NewYork),
            self.consolidate_daily)

    def consolidate_daily(self):
        bar = self.consolidator.WorkingData
        if bar is None:
            return

        self.Log(f"bar: Open at {bar.Open} ({bar.Time}), Close at {bar.Close} ({bar.EndTime})")
        self.consolidator = QuoteBarConsolidator(60*25)

    def OnData(self, data):
        self.consolidator.Update(data[self.symbol])