| Overall Statistics |
|
Total Orders 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Start Equity 1000.00 End Equity 1000 Net Profit 0% Sharpe Ratio 0 Sortino 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 0 Tracking Error 0 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset Portfolio Turnover 0% |
# region imports
from AlgorithmImports import *
# endregion
class MinimalTestAlgorithm(QCAlgorithm):
def initialize(self):
self.set_start_date(2024, 5, 2) # Start date for backtest (first trading day of the year)
self.set_end_date(2024, 5, 10) # End date for backtest
self.set_cash(1000) # Capital for backtest
self.eurusd = self.add_forex("EURUSD", resolution=Resolution.MINUTE, market=Market.OANDA).Symbol
self.debug(f"Initialization Complete - Start Date: {self.start_date}, End Date: {self.end_date}, Pair: {self.eurusd}")
# Attempt to retrieve historical data for debugging
history = self.History(self.eurusd, 10, Resolution.Minute)
self.debug(f"Retrieved {len(history)} historical data points")
def on_data(self, data):
self.debug(f"OnData called at {self.Time}")
if self.Time.date() == self.start_date.date():
self.debug(f"OnData triggered on Start Date: {self.Time}")
if self.Time.date() == self.end_date.date():
self.debug(f"OnData triggered on End Date: {self.Time}")
def on_end_of_algorithm(self):
self.debug("Algorithm Ended")
# Ensure this script is within a proper Lean Environment and run as expected.