Counting Consecutive Rising and Falling Price Highs from Candles
Summary
This beginner post presents a small script for counting runs of consecutive rising or falling market observations from candlestick data. Its example compares each candle’s high with neighboring highs, resets the run counter when direction changes or prices are unchanged, and reports the time, candle high and low, direction, and run duration. It also notes an alternative comparison between the next candle’s high and the current candle’s low for identifying directional movement.
The author says the intent was to explore whether a streak, such as consecutive daily advances, might inform the odds of another advance. The displayed material reports counts and sample output format, but provides no statistical results or evidence that streak length predicts returns. The author also notes that the available history in the testing environment was limited to about fifty days, making pattern analysis difficult. The code is an exploratory example, and its indexing and conditions should be checked before use with real data.
Key ideas
- Consecutive directional runs can be counted by comparing highs across adjacent candles.
- Counters reset when the observed direction changes or the price is unchanged.
- The script logs timestamps, candle ranges, direction labels, and run duration for inspection.
- The post proposes studying whether streak length relates to the probability of continuation but reports no such evidence.
- A short available history limits conclusions, and the sample code needs validation before practical use.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.