# noob-coder18/technicalanalysisautomation architecture

> Architecture diagram of the GitHub repository noob-coder18/technicalanalysisautomation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/noob-coder18/technicalanalysisautomation
- Repository: https://github.com/noob-coder18/technicalanalysisautomation

## Overview

##### Main Components
- Data Input: Represent the CSV files (BTCUSDT3600.csv and BTCUSDT86400.csv) that provide time series data for the analysis.
- Core Analysis Modules: Identify each Python module as an independent technical analysis function. These include:
– directional_change.py
– flags_pennants.py
– harmonic_patterns.py
– head_shoulders.py
– mp_support_resist.py
– perceptually_important.py
– pip_pattern_miner.py
– retracement_ratios.py
– rolling_window.py
– trendline_automation.py
– wf_pip_miner.py
- Testing Components: Highlight the test files (e.g., test_flag_patterns.py, test_hs_patterns.py) that ensure the analysis functions work as expected.
- External Dependencies: Note the dependency on numpy (with a specific version 1.23.1) and the mention of pyclustering. Even though the latter might not be fully compatible with newer numpy versions, it should be included in the dependency layer.

##### Component Relationships and Data Flow
- Data Flow: Start with the CSV data files acting as the input layer, feeding data into the data ingestion/loading routines (these would likely be embedded in one or more modules).
- Testing Layer: Connect each test module to its corresponding analysis module to indicate that each algorithm is independently validated.

##### Architectural Patterns
- Modular Design: Emphasize that each technical analysis function is implemented as a standalone Python module—this modular design allows independent updates and testing.
- Functional Separation: While there is no client-server or MVC separation (common in full-stack applications), it is important to clearly separate business logic (analysis algorithms) from data inputs and tests.

##### Technologies and Libraries
- Python is the primary language.
- numpy (fixed version 1.23.1) is a key library.
- pyclustering is mentioned, so indicate this as an external library that the analysis functions might be leveraging.
- Standard file I/O with CSV files.

##### Elements
- Each module (directional_change, flags_pennants, harmonic_patterns, head_shoulders, etc.) is represented as a separate component.
- External Dependencies as an auxiliary block, listing numpy (with the specified version) and pyclustering.
- Testing Layer with nodes representing test_flag_patterns.py, test_hs_patterns.py, etc., and connect them back to their associated core modules.

## Diagram (Mermaid)

```mermaid
graph TD
  %% Data Input Layer
  subgraph "Data Input Layer"
    CSV1["BTCUSDT3600.csv"]:::csv
    CSV2["BTCUSDT86400.csv"]:::csv
    DI["Data Ingestion"]
  end
  
  CSV1 --> DI
  CSV2 --> DI

  %% External Dependencies
  subgraph "External Dependencies"
    NPY["numpy==1.23.1"]:::external
    PC["pyclustering"]:::external
  end
  
  NPY --> DI
  PC --> DI

  %% Core Analysis Modules
  subgraph "Core Analysis Modules"
    DM["directional_change.py"]:::analysis
    FP["flags_pennants.py"]:::analysis
    HP["harmonic_patterns.py"]:::analysis
    HS["head_shoulders.py"]:::analysis
    MS["mp_support_resist.py"]:::analysis
    PI["perceptually_important.py"]:::analysis
    PP["pip_pattern_miner.py"]:::analysis
    RR["retracement_ratios.py"]:::analysis
    RW["rolling_window.py"]:::analysis
    TA["trendline_automation.py"]:::analysis
    WM["wf_pip_miner.py"]:::analysis
  end
  
  DI --> DM
  DI --> FP
  DI --> HP
  DI --> HS
  DI --> MS
  DI --> PI
  DI --> PP
  DI --> RR
  DI --> RW
  DI --> TA
  DI --> WM
  
  %% Inter-module dependency: Rolling Window -> Trendline Automation
  RW -->|"feeds"| TA

  %% Testing Layer
  subgraph "Testing Layer"
    TFP["test_flag_patterns.py"]:::test
    THS["test_hs_patterns.py"]:::test
  end
  
  TFP -->|"tests"| FP
  THS -->|"tests"| HS

  %% Click Events
  click CSV1 "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//BTCUSDT3600.csv"
  click CSV2 "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//BTCUSDT86400.csv"
  click DM "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//directional_change.py"
  click FP "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//flags_pennants.py"
  click HP "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//harmonic_patterns.py"
  click HS "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//head_shoulders.py"
  click MS "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//mp_support_resist.py"
  click PI "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//perceptually_important.py"
  click PP "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//pip_pattern_miner.py"
  click RR "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//retracement_ratios.py"
  click RW "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//rolling_window.py"
  click TA "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//trendline_automation.py"
  click WM "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//wf_pip_miner.py"
  click TFP "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//test_flag_patterns.py"
  click THS "https://github.com/noob-coder18/technicalanalysisautomation/blob/main//test_hs_patterns.py"

  %% Styles
  classDef csv fill:#cce5ff,stroke:#004085,stroke-width:2px;
  classDef analysis fill:#d4edda,stroke:#155724,stroke-width:2px;
  classDef external fill:#fff3cd,stroke:#856404,stroke-width:2px;
  classDef test fill:#f8d7da,stroke:#721c24,stroke-width:2px;
```
