A Prime-Number Heuristic and Randomized Signals in a Long-Biased Strategy
Summary
This script experiments with a long-biased strategy built around two unusual signal families. First, it rescales OHLC prices according to broad price ranges and checks whether the resulting values are divisible by small integers, treating bars whose OHLC values pass this check as prime-like pivots. Second, it generates a pseudo-random value from a Box-Muller-style transformation of a rolling OHLC average and standard deviation. Comparisons of that value with bar highs and lows create bullish or bearish dots, with repeated same-color dots highlighted.
The trading rules enter long positions on selected dates when the randomized value falls below the low, and add further entries under a related condition. The prime-like OHLC condition can close positions. The script also displays volume and recent candle counts. The author explicitly notes scaling limitations and that the prime method is not reliable; the code provides no validation that these price transformations or random signals have predictive value. The date-gated entries and repeated orders further limit general use.
Key ideas
- The script classifies scaled OHLC values as prime-like by checking divisibility by small integers.
- A pseudo-random series based on a rolling price mean and standard deviation is compared with highs and lows to form signals.
- Long entries are gated by selected calendar dates, and several entry identifiers can add positions.
- A bar whose OHLC values all pass the prime-like check triggers a position close.
- The document warns that its scaling and prime heuristic are limited and provides no evidence of predictive performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.