The following chart shows the stop price update for a live deployment where a buy order for SPY was placed during a time where SPY prices where slowly decreasing. The initial stop price was $458 with a trailing amount of $0.4. As shown in the chart, the stop price was updated to follow the lowest low price as it decreased.
On the other hand, for a sell order with an initial stop price of $457.7 and a trailing amount of $0.4:
Related Issue
Motivation and Context
Supporting more order types.
Requires Documentation Change
How Has This Been Tested?
Unit tests.
Live deployments.
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. Please add associated performance test and results)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
This adds support for trailing stop orders, implemented in https://github.com/QuantConnect/Lean/pull/7402.
The following chart shows the stop price update for a live deployment where a buy order for SPY was placed during a time where SPY prices where slowly decreasing. The initial stop price was $458 with a trailing amount of $0.4. As shown in the chart, the stop price was updated to follow the lowest low price as it decreased.
On the other hand, for a sell order with an initial stop price of $457.7 and a trailing amount of $0.4:
Related Issue
Motivation and Context
Supporting more order types.
Requires Documentation Change
How Has This Been Tested?
Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>