Skip to content

feature: add public order properties#9549

Merged
Romazes merged 3 commits into
QuantConnect:masterfrom
Romazes:feature-public-order-properties
Jun 19, 2026
Merged

feature: add public order properties#9549
Romazes merged 3 commits into
QuantConnect:masterfrom
Romazes:feature-public-order-properties

Conversation

@Romazes

@Romazes Romazes commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds PublicOrderProperties so an algorithm can opt into Public.com extended-hours trading and choose margin or cash-only buying power per order. The Lean.Brokerages.Public plugin reads these and maps OutsideRegularTradingHours to the request's equityMarketSession field and UseMargin to its useMargin field.

DefaultOrderProperties = new PublicOrderProperties
{
    OutsideRegularTradingHours = true, // route equity orders to the EXTENDED session
    UseMargin = false                  // use cash-only buying power
};

Related PR(s)

N/A

Related Issue

N/A

Motivation and Context

Public.com supports an extended trading session and a per-order choice between margin and cash-only buying power. Lean had no order-properties type to express either, so these options could not be set from an algorithm.

Requires Documentation Change

No.

How Has This Been Tested?

Manually placed equity orders through the Lean.Brokerages.Public plugin and confirmed the place-order request carried equityMarketSession (CORE/EXTENDED) and useMargin as set on the properties.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

- add OutsideRegularTradingHours for extended-hours equity orders
- add UseMargin to select margin or cash-only buying power
@Romazes Romazes requested a review from Martin-Molinero June 19, 2026 15:50
@Romazes Romazes self-assigned this Jun 19, 2026
Romazes added 2 commits June 19, 2026 21:05
- make UseMargin nullable so an unset margin account uses margin buying power
- resolve UseMargin from account type in CanSubmitOrder; cash forces it off
@Romazes Romazes merged commit 22655e8 into QuantConnect:master Jun 19, 2026
5 of 8 checks passed
@Romazes Romazes deleted the feature-public-order-properties branch June 19, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants