Price Structure Suite Indicator Development Instructions## 1. Project Background Price Structure Suite aims to converge the common "structure-form-volume-energy-multi-period-risk" analysis process in subjective trading into an MT4 indicator. The indicator only relies on market price and tick volume, and does not introduce external libraries, which facilitates rapid deployment and debugging. ## 2. Design goal - Structured output: Automatically mark swing high and low points and give structural bias (trend, shock). - Pattern Recognition: Detect common reversal and continuation patterns to help traders quickly locate potential opportunities. - Environmental filtering: Use the Tick quantity and multi-period direction to determine whether there is momentum resonance and reduce noise signals. - Risk Warning: Estimate recommended positions based on ATR and account funds to provide risk reference for trading decisions. - Easy to Expand: Modular function design makes it easy to replace or add recognition logic. ## 3. Module structure | Module | Description | Main functions | Check double top/double bottom, head and shoulders, triangle and other forms, and draw text marks on the chart | EvaluatePatterns and Detect* series | | Volume energy filtering | Calculate the average Tick volume, identify high volume bars, and assist in judging breakthroughs/false breakthroughs | SimpleAverageVolume, VolumeBoostBuffer | HigherTimeframeBias | | Risk Panel | Calculate ATR, each risk amount, recommended lot size, and output through Comment | UpdateRiskDashboard, PipValue | Each module is independent of each other, and is connected in series through the sequential calls in OnCalculate to achieve a complete link from data collection to signal filtering and risk prompts. ## 4. Data flow overview 1. OnCalculate scans to the left root by root to detect swing high and low points. 2. The newly added swing points are written to the circular queue and trigger EvaluatePatterns. 3. Synchronously calculate structure bias (DetermineStructureBias) and multi-cycle bias (HigherTimeframeBias). 4. SimpleAverageVolume compares the current Tick volume to see whether it is amplified, and writes the result into VolumeBoostBuffer. 5. Call UpdateRiskDashboard after each refresh to output risk information. ## 5. Input parameters - SwingDepth: Determination depth of swing point. The larger the value, the more noise-resistant and the less signal. - MaxLookbackBars: The maximum number of historical items processed by a single refresh, to control performance. - VolumeLookback / VolumeFactor: Volume energy average window and volume multiple threshold. - HigherTF / HigherMAPeriod: the period and length of multi-period EMA. - AtrPeriod / RiskPercent / AccountValueOverride: Risk calculation related configurations. - PatternTolerancePips: The allowed deviation of pattern points, adapting to the fluctuations of different varieties. - LabelOffsetPips: The offset of the graphic label relative to the price. - Enable* switch: You can enable/disable various form recognition independently. ## 6. Core implementation details ### 6.1 Swing point and structural bias - IsSwingHigh/Low uses a symmetric window to determine the extreme value. - RegisterSwing maintains a circular array of length MAX_SWINGS. - DetermineStructureBias determines the trend direction based on the last two pairs of high and low points: HH+HL is considered an increase, LL+LH is a decrease, and the rest are considered shocks. ### 6.2 Pattern recognition pipeline - EvaluatePatterns is run every time a new swing point occurs. - Double top/double bottom verified by height difference tolerance and opposite swing in the middle. - The head and shoulders pattern needs to meet the approximate height of the left and right shoulders, the horizontal neckline, and the head being higher (lower) than the shoulders. - Triangle recognition determines converging highs/rising lows (or vice versa) to differentiate between upswings and downswings. - RenderPattern uses text objects to annotate names to avoid repeated signals passing through the recent index cache. ### 6.3 Tick volume filtering - SimpleAverageVolume averages the recent VolumeLookback root tick volume. - If the current Tick volume > Mean × VolumeFactor and the structural bias is non-zero, then draw a volume bar in the histogram buffer. ### 6.4 Multi-Period and Risk - HigherTimeframeBias uses iBarShift to align the timestamps, obtain the high-period EMA, and return the direction (+1/-1/0). - UpdateRiskDashboard derives the risk per lot from ATR, calculates the recommended lot size based on account equity, and outputs it in the upper left corner of the chart. ## 7. Usage suggestions 1. Verification: Use the playback mode in the strategy tester to observe whether the structure, shape and energy prompts match the market feel; if necessary, increase SwingDepth to suppress noise. 2. Parameter Tuning: Different varieties/periods have large fluctuations. It is recommended to adjust PatternTolerancePips and VolumeFactor according to ATR. 3. Review: Combine the Comment output with the historical records and take screenshots to record the actual performance and provide a basis for subsequent improvements. 4. Integration with EA: If automation is required, the structural bias and morphological signals can be written into global variables or files, and then read and executed by EA. ## 8. Expansion direction - Add more patterns (such as harmonics, 1-2-3 reversals) or price action determination (pin lines, inside line filtering). - Introduce structural damage alerts (e.g. trend lines, previous high and low breakouts) and push notifications. - Expanded to MT5, using real trading volume and order book data to enhance the energy module. - Construct a backtest statistical framework to output quantitative indicators such as signal winning rate and mean retracement. ## 9. File information - Indicator source code: PriceStructureSuite.mq4 - This development document: Development Document.md The two files are located in c:\Users\PCPCPCP\Documents\JG and can be viewed or modified directly in the MetaEditor and Markdown editors.
💡 Featured Recommendations
🔗 You May Be Interested In