Skip to content

Backtesting: Flexible Settlement date #8659

Open
@Romazes

Description

@Romazes

Expected Behavior

Create flexible DefaultSettlementDays depending on Securities.
For instance:
Run algo before May 28, 2024 the DefaultSettlementDays for Equites => 2 days.

Actual Behavior

Use the DefaultSettlementDays for Equites => 1 day always.

Potential Solution

Should use different SettlementDays by Securties and backtesting time. The SettlementDays was changed (look at attached PR) to 1 day, but if the user runs algo before SettlementDays changed it will use the wrong amount of settled cash in the user balance.

Also, we should pay attention to different markets (international ones). Different SettlementDaya values can be used.

Reproducing the Problem

Run algo before May 28, 2024.
Buy or sell' SPY' on the same day and ensure that cash is settled successfully.

Related PRs

System Information

N/a

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions