Read the calculation in five passes
Record the source version and inputs before changing anything. Work from the data toward the output rather than assuming the label explains the code.
- Inputs: identify lengths, price source, session, requested timeframe, and any parameter that changes timing.
- Calculations: check lookbacks, warm-up requirements, volume availability, and higher-timeframe data requests.
- Conditions: distinguish a crossing event from a condition that remains true for several bars.
- Drawings: inspect offsets and whether a marker is placed on an earlier bar after later confirmation.
- Alerts: compare the complete trigger with the plotted condition and inspect the selected frequency.