Request for Advanced Historical OHLC Data Analysis Tool (Excel VBA / Python)

Specification

Request for Advanced Historical OHLC Data Analysis Tool (Excel VBA / Python)


1. Project Title:

Advanced Automated Price Pattern Analysis Tool with Trend Context and Custom Filters


2. Project Goal:

Create a tool to help analyze historical data from MT5 and automatically search for recurring price patterns. The primary goal is to provide clear statistics on the profitability and success rate of these patterns, including detailed analysis of candles, wicks, and the relationship with trends that preceded and followed the pattern.

Despite the detailed specification, I am fully open to discussion and prepared to talk through any simplifications or optimizations that could save time, reduce costs, and minimize errors. The most important thing for me is a functional result that reliably helps with decision-making.


3. Input Data Specifications:

3.1. Data Source and Manual Preparation Process:

The user will manually export historical OHLC data from MT5.

  • MT5 Export Process:

    1. In MT5, go to the top menu: View -> Symbols .

    2. Select the desired symbol (e.g., EURUSD).

    3. Go to the Bars tab.

    4. Choose the appropriate timeframe, start, and end date.

    5. Click Request to load data, then Export Bars to save as an Excel file.

  • User's Excel Preparation:

    1. The automatically generated Excel file from MT5 will be opened.

    2. The entire first column (containing all data) will be copied.

    3. This copied column will then be pasted into the user's own custom Excel workbook.

    4. This process will be repeated for each required timeframe, resulting in multiple columns of raw MT5 data, placed side-by-side on the first sheet of the custom Excel file.

    5. Row 1 (Header Row): The user will manually insert a new first row.

      • Cell A1: Symbol Name (e.g., "EURUSD").

      • Above each column containing MT5 data, the user will manually write the corresponding timeframe (e.g., "1 minute", "5 minutes", "1 hour").

  • Data Volume: The Excel sheet is expected to contain a large volume of data, potentially over 1,000,000 rows per column, depending on data availability and Excel's capabilities.

3.2. Data Interpretation by Program:

The program must be capable of correctly parsing and interpreting the data from this custom Excel source. For each row (candle), it must correctly identify and process the following information:

  • Symbol: Read from cell A1.

  • Date Components: Year, Month, Day (as numbers).

  • Day of Week: As text (e.g., "Monday", "Tuesday", etc.).

  • Time Components: Hour, Minute, Second.

  • Timeframe: Identified from the custom header in Row 1 for each data column.

  • OHLC Values: Open, High, Low, Close of the given candle.

  • Volume Data: Tick Volume, Real Volume (if available and exported correctly, otherwise Tick Volume).

  • Spread: The spread value at the time of the candle.


4. Key Analytical Functions:

The program will perform comprehensive analysis based on the parsed data:

4.1. Pattern Identification and Directional Analysis:

  • Timeframe Interval Search: Identification of consistent patterns within specified timeframe intervals (for example, for a 3-minute timeframe, find all occurrences of 09:03 to 09:06 for EVERY DAY).

  • OHLC Differences & Trend Direction:

    • Calculation of the difference between various OHLC points (e.g., Close - Open for body, High - Low for total range).

    • Determination of the directional trend (Up/Down) of the candle based on Close vs. Open.

    • Calculation of profit/loss in pips/points for these differences.

    • Averaging these profit/loss values across all occurrences of the given pattern.

4.2. Wick/Shadow and Body Position Analysis:

  • Lower Body Boundary vs. Low: Calculation of the difference between the lower boundary of the candle body (which can be Open or Close, whichever is lower) and Low.

  • Upper Body Boundary vs. High: Calculation of the difference between the upper boundary of the candle body (which can be Open or Close, whichever is higher) and High.

  • Body Position within Total Range (%):

    • Upper Body Position: Calculation of the percentage of the candle's total range (High - Low) that the upper body boundary (the higher of Open, Close) represents from the Low. (e.g., if the total range is 100 points and the upper body boundary is at 86 points from Low, the value is 86%).

    • Lower Body Position: Calculation of the percentage of the candle's total range (High - Low) that the lower body boundary (the lower of Open, Close) represents from the Low. (e.g., if the total range is 100 points and the lower body boundary is at 21 points from Low, the value is 21%).

    • Averaging these percentage values.

4.3. Preceding and Subsequent Trend Analysis (Crucial):

This section aims to analyze the price trend that preceded and followed the identified price pattern. The analysis will be performed exclusively on data from the 1-minute timeframe. The currently analyzed candle/interval (i.e., the pattern itself) is NOT included in the trend calculation.

The goal is to categorize historical trends into two types—"clean" and "dirty"—and calculate their parameters (number of candles, length in pips/points) for three defined phases:

  1. Trend before the pattern: Analysis of the trend that immediately precedes the currently observed pattern.

  2. Trend within the pattern: Analysis of the pattern itself (already described above in section 4.1).

  3. Trend after the pattern: Analysis of the trend that immediately follows the currently observed pattern.

  • Definitions of Trend Types:

    • a) "Clean" Trend (Clean Trend):

      • This is an uninterrupted sequence of candles moving in the same direction.

      • Calculation: The total number of candles in this uninterrupted sequence and the trend length in pips/points are calculated from the Open of the first candle to the Close of the last candle in the given trend segment (before or after the current pattern).

    • b) "Dirty" Trend (Dirty Trend):

      • This is a sequence of candles moving in one predominant direction, but it tolerates an interruption by one or more counter-trend candles. The interruption must not disrupt the overall structure of the original trend.

      • Specification of Counter-Trend Candles:

        • For an Up Trend: A counter-trend candle (with Close below Open) is acceptable if its High or Low (or any other value) does not fall below the Low of the preceding candle in the trend. The trend is considered to be continuing if, after the counter-trend candle, a candle follows that creates a new High or Close above the High or Close of the preceding candle in the trend.

        • For a Down Trend: A counter-trend candle (with Close above Open) is acceptable if its High or Low (or any other value) does not rise above the High of the preceding candle in the trend. The trend is considered to be continuing if, after the counter-trend candle, a candle follows that creates a new Low or Close below the Low or Close of the preceding candle in the trend.

      • Calculation: The total number of candles in this sequence, including acceptable counter-trend candles, and the trend length in pips/points are calculated from the Open of the first candle to the Close of the last candle in the given trend segment (before or after the current pattern).


5. Output and Display (Extended Requirements):

5.1. Tabular Display of Results:

The main output will be on a new sheet in Excel (e.g., "Results"), where each row represents a found pattern. The columns will be in the following order and with defined filters:

  • Symbol: (read from header)

  • Time Segment (Based on Input Data):

    • Timeframe Interval: (e.g., M3)

    • Timeframe From When To When: Specific time interval of the found pattern (e.g., 09:03:00 - 09:06:00).

  • My Custom Filter: Intraday Time Interval:

    • Allows manual entry of a specific time (Year, Month, Day, Hour, Minute, Second) for both the start and end time of the analyzed interval. The program will then use the OHLC values from the 1-minute timeframe that fall within this manually defined segment.

    • Example: User enters 09:32:00 as the start and 10:15:00 as the end.

  • Current Candle Trend / Manually Selected Intraday Time Interval:

    • Trend Direction: "Up" or "Down".

      • My Custom Filter: Option for manual selection of "Up" or "Down" to filter results.

    • Trend Occurred Between ?? and ??: This will state the OHLC combination that determined the direction (e.g., "Open and Close", or "Low and High" for the total range).

      • My Custom Filter: Option for manual selection of any combination from "Open, High, Low, Close" to define which points should be compared to determine the trend.

  • Percentage of Same Trend Occurrence: Value 0-100%.

    • My Custom Filter: Option for manual entry of "is greater than" and a value (0-100), e.g., "90", to display only patterns with a high success rate.

    • Automatic Sum of All Analyzed Data: The program will automatically display the total number of analyzed data points here (e.g., "123"). This value will indicate how many candles/intervals the percentage is calculated from. Example: "90% success rate from a total of 123 analyzed samples".

    • Visualization of Incorrect Occurrences: A checkbox that, when activated, will highlight in red the cells (or entire rows) in the first source Excel sheet (in the given column/timeframe) where the pattern did NOT repeat as expected. This will allow the user to subsequently filter by color for detailed manual analysis.

  • Average Difference in Pips/Points:

    • a) For "Candle Body": Difference between Open and Close.

      • My Custom Filter: "is greater than", value (0+ pips).

    • b) For "Entire Candle including Wicks/Shadows": Difference between Low and High.

      • My Custom Filter: "is greater than", value (0+ pips).

    • c1) Difference Between Lower Body Boundary and Low: Average.

      • My Custom Filter: "is greater than", value (0+ pips).

    • c2) Position of Upper Body Boundary Relative to Total Candle Range (in % from Low): Average (0-100%).

      • My Custom Filter: "is greater than", value (0+).

    • d1) Difference Between Upper Body Boundary and High: Average.

      • My Custom Filter: "is greater than", value (0+ pips).

    • d2) Position of Lower Body Boundary Relative to Total Candle Range (in % from Low): Average (0-100%).

      • My Custom Filter: "is greater than", value (0+).

  • Average (Tick) Volume:

    • My Custom Filter: "is greater than", value (0+).

  • Average Spread:

    • My Custom Filter: "is greater than", value (0+).

  • Previous Trend (Excluding Currently Displayed Candle):

    • a) Clean Trend:

      • aa) Number of Candles:

        • My Custom Filter: "is greater than", value (e.g., "2").

      • ab) Trend Length in Pips/Points:

        • My Custom Filter: "is greater than", value.

    • b) Dirty Trend:

      • ba) Number of Candles:

        • My Custom Filter: "is greater than", value (e.g., "2").

      • bb) Trend Length in Pips/Points:

        • My Custom Filter: "is greater than", value.

  • Future Following Trend (Excluding Currently Displayed Candle): (Same columns and filters as for Previous Trend).

5.2. Graphical Display (Mini-charts):

Regarding the visual display of details for a selected row/pattern, I'm essentially flexible about the form you choose. It could be dynamic mini-charts, a display on a new sheet using static tables, or any other method. For me, the key is to have a quick and clear visual overview of all relevant details after selecting a row, in a way that is most technically efficient for you.

Upon selecting a row with a specific pattern (e.g., by clicking or checking a box), a set of mini-charts (several side-by-side) for this specific pattern will be displayed at the bottom of the screen/Excel (with automatic scrolling/maintaining position at the bottom when scrolling with the right cursor/bar):

  1. Monthly Occurrences:

    • Horizontal axis: Months of the year (textually: "January", "February", ...).

    • Vertical axis: Percentage of repetition (0-100%).

    • Each bar for a month will be divided into red color (with a number) for cases where the pattern did NOT repeat as expected, and green color (with a number) for cases where the pattern did repeat.

  2. Weekly Occurrences:

    • Horizontal axis: Days of the week (textually: "Monday", "Tuesday", ...).

    • Vertical axis: Percentage of repetition (0-100%).

    • Same color distinction as the monthly graph.

  3. Trend Direction Graph: Visualization of average profit/loss for the "Up" and "Down" directions of the analyzed pattern.

  4. OHLC Differences Graph: Visualization of average values for a), b), c1), c2), d1), d2) from section 5.1 (Average Difference in Pips/Points).

  5. Volume Graph: Average tick volume for the pattern.

  6. Spread Graph: Average spread for the pattern.

  7. Previous Clean Trend Graph: Visualization of the average number of candles and length in pips for the "clean" trend BEFORE the pattern.

  8. Previous Dirty Trend Graph: Visualization of the average number of candles and length in pips for the "dirty" trend BEFORE the pattern.

  9. Future Clean Trend Graph: Visualization of the average number of candles and length in pips for the "clean" trend AFTER the pattern.

  10. Future Dirty Trend Graph: Visualization of the average number of candles and length in pips for the "dirty" trend AFTER the pattern.


6. Technical Requirements:

  • Platform:

    • Preferred: Standalone Python script with a simple GUI (Graphical User Interface) that can read/write to Excel files. Python offers a robust and flexible solution for processing large volumes of data.

    • Alternative: Microsoft Excel Add-in (VBA) for seamless integration with the user's workflow.

    • The final decision and proposal on which solution will be most suitable is left to the developer, as the most important thing for me is a reliable and functional result.

  • Language: Python or VBA.

  • User Friendliness: The tool must be designed for intuitive use even by non-technical users.


7. Important Note on Automatic Data Download:

If the developer is able to ensure that the program will be capable of automatically downloading data directly from MT5 (for all pre-selected timeframes and assets), this is acceptable and welcome. However, given the critical nature of the input data, this automatic download must be absolutely flawless and reliable! If there is any risk of errors during automatic download, the original manual export and copying process is preferred to ensure data integrity.


8. Budget:

The price for this project is negotiable. I would like to add that, although the specification is detailed, I am fully open to discussion. If the project seems complex at first glance, or if you have any suggestions for improvements or simplifications to save time, reduce costs, and minimize process errors, I am ready to discuss them and be flexible.


Responded

1
Developer 1
Rating
(1)
Projects
2
0%
Arbitration
1
0% / 100%
Overdue
1
50%
Free
Published: 4 codes
2
Developer 2
Rating
(163)
Projects
236
32%
Arbitration
30
27% / 30%
Overdue
26
11%
Free
3
Developer 3
Rating
Projects
0
0%
Arbitration
1
0% / 100%
Overdue
0
Free
4
Developer 4
Rating
(152)
Projects
228
80%
Arbitration
22
27% / 50%
Overdue
11
5%
Free
Published: 24 articles, 1882 codes
5
Developer 5
Rating
Projects
2
0%
Arbitration
4
25% / 50%
Overdue
1
50%
Free
6
Developer 6
Rating
(14)
Projects
20
20%
Arbitration
3
33% / 67%
Overdue
3
15%
Working
7
Developer 7
Rating
(48)
Projects
58
34%
Arbitration
15
27% / 60%
Overdue
1
2%
Working
8
Developer 8
Rating
Projects
0
0%
Arbitration
3
0% / 100%
Overdue
0
Working
Similar orders
EA 45 - 205 USD
If EMA20 > EMA50 AND RSI > 55 AND No Open Position THEN Buy SL = 50 pips TP = 100 pips If Profit > 30 pips Move SL to Break Even If Profit > 50 pips Enable Trailing Stop
Hello Traders and Investors, I am a professional algorithmic trading developer specialized in building high-quality Expert Advisors (EAs), Indicators, Scripts, and Trade Management Tools for MetaTrader 4 and MetaTrader 5. With extensive experience in financial markets and trading automation, I can transform your trading ideas into reliable and efficient solutions with clean, optimized, and well-structured code. My
Привіт. Шукаю когось, хто б застосував мій код як бота . Я торгую індексом Aus_200 SFE (не XJO). Бот базується на MACD входу/виходу, RSI, стохастиці та vwap. Як тільки роботу приймуть, мені потрібно внести кілька коректив; однак, нічого суттєвого. Дякую
MT4/MT5 HFT EA us30 30 - 3000 USD
Hello everybody, I'm looking for an experienced MQL4/MQL5 developer to optimize a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5. The EA performs consistently and profitably on demo accounts, but when it is run on Raw and Standard live accounts under what appear to be the same trading conditions, it begins generating losses. I do not have the original source code (.mq4/.mq5); I only have the
I need an Expert Advisor for MT5 on XAUUSD 1min timeframe using SMC concepts. STRATEGY RULES: SELL: 1. Identify previous day High/Low as liquidity 2. Entry only during London-NY session: 15:00-19:00 GMT+3 or broker clock. 3. If price sweeps previous day High and closes back below it 4. Check for bearish 1min FVG below sweep candle 5. Wait for BOS - lower low 6. Entry: Sell/buy at 50% of the FVG 7. SL: 10 pips above
I have a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5 designed primarily for US30 (Dow Jones Index) . The EA performs consistently and profitably on demo accounts, but when I run it on an IC Markets Raw or Standard live account, it starts generating losses under what appear to be the same trading conditions. At this time, I cannot provide the source code (.mq4/.mq5). I can only provide the
I want to build a fundamental news trading bot that trade off economic news data, as we know every economic news data released always have effect on the asset associated with it, so this bot will take a trade instantly based on the news data released either to buy or sell, it will come with good money management and also SL and TP target based on price and pips value
I have a EA/indicator that I want built. I should say 1st off dont know how to code myself so I will be using AI to verify that the source code is complete and matches the documents spec or if better so if you can not truly do the job do not waste either of out time. This is a idea I came.up wit and used AI to produce a framework for it.... and of course AI isn't 100% accurate so I need a knowledgeable quantitative
Bot 30 - 80 USD
I am looking for an experienced MQL5 developer to create a fully automated Expert Advisor (EA) for MetaTrader 5 based on a Price Action strategy. The bot needs to automatically identify specific candlestick formations and market structure levels, execute trades, and manage risk using a dynamic trailing stop.The EA should monitor the chart for the following price action setup:Market Structure / Trend Filter:The bot
Master mind 30+ USD
Start ↓ Detect Trend (H4) ↓ Confirm Structure (H1) ↓ Wait for Pullback ↓ Check Indicators ↓ Calculate Confidence Score ↓ Score ≥ 80? ├── No → Wait └── Yes ↓ Calculate Lot Size ↓ Place Order ↓ Set Stop Loss ↓ Set Take Profit ↓ Manage Trade ↓ Move to Break-even ↓ Trail Stop ↓ Close Trade. IF Price > EMA200 (H4) AND EMA50 > EMA200 (H4) AND ADX > 25 AND RSI between 55 and 70 AND MACD Main > Signal AND Bullish engulfing

Project information

Budget
30+ USD
Deadline
from 1 day(s)