Closing Pyramided Long Entries Individually by Entry ID
Summary
This code example demonstrates how to manage exits for separately identified long entries when pyramiding is enabled. It defines weekday-based conditions: one entry is submitted on Monday and another on Tuesday, then each position is closed on a different later weekday by referencing its entry identifier. The configuration permits two accumulated entries and specifies that closing behavior should apply to the matching entry rather than treating all open trades as one position.
The example teaches order association and selective position closing in a trading script. It contains no market signal rationale, instrument specification, performance evidence, or risk analysis. Its calendar conditions are illustrative, and the snippet does not discuss holidays, missing bars, execution behavior, or how entry signals would be made useful in a real strategy.
Key ideas
- Unique entry identifiers allow exit orders to target particular positions.
- The example opens separate long entries on two weekdays and closes them on later weekdays.
- Pyramiding and the close-entry rule affect how multiple entries are managed.
- The calendar schedule illustrates mechanics and offers no evidence of trading profitability.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.