qstrader icon indicating copy to clipboard operation
qstrader copied to clipboard

Why start_date and end_date are not optional?

Open Kroid opened this issue 7 years ago • 1 comments

In TradingSession, start_date & end_date - requires fields. But why? In price_handler they are optional values with None as default.

Kroid avatar Jul 16 '17 15:07 Kroid

Are you looking at this part?

        start = None
        end = None
        if self.start_date is not None:
            start = df.index.searchsorted(self.start_date)
        if self.end_date is not None:
            end = df.index.searchsorted(self.end_date)

JamesKBowler avatar Jul 25 '17 14:07 JamesKBowler

This has been fixed and is present in the latest version. Start and End dates can be changed in backtest.py

Thanks

juliettejames avatar Feb 07 '24 11:02 juliettejames