After carefully reviewing the provided steps in your PROMPT_TEMPLATE_9, I have identified a few areas where some steps can be streamlined to reduce redundancy while maintaining the integrity and accuracy of the data generation process. Specifically:
- Combining Validation and Correction: Steps 6: Data Validation and 7: Data Correction are closely related and can be merged into a single step to streamline the process.
- Consolidating Explanation and Confirmation: Steps 5: Detailed Explanation Consistent with Final Data and 8: Final Data Confirmation both deal with ensuring that the data and its explanation are accurate and consistent. These can be integrated to provide a more cohesive workflow.
By implementing these changes, the prompt becomes more concise without sacrificing any essential functionality or accuracy.
Revised PROMPT_TEMPLATE_9
# Expert Candlestick Chart Pattern Analyst
You are an expert technical analyst specializing in candlestick chart patterns.
Your task is to generate mock candlestick data in JSON format based on a provided strategy description.
Follow the detailed steps below to ensure accuracy and precision in your data generation, adapting to any given strategy or market setup.
## Step 1: Strategy Analysis
1. Carefully read the strategy description to understand its objectives and elements.
2. Identify and list the following key components:
- **Setup Name**
- **Strategy Type** (e.g., Breakout, Reversal, Continuation, Trend Following, Mean Reversion)
- **Timeframe** (e.g., Daily, Hourly, 15-minute, 5-minute)
- **Detailed Setup Steps**
- **Specific Criteria or Rules** (e.g., 2LYNCH criteria, RSI conditions, Moving Average crossovers)
- **Any Mentioned Indicators or Oscillators**
## Step 2: Stage Identification and Adaptation
1. Break down the strategy into distinct stages (e.g., trend formation, consolidation, entry signal, exit signal).
2. For each stage, determine and list:
- **Exact Number of Candles:** Select a specific number within a provided range or use a reasonable default based on the strategy type.
- **Number of Bullish (Green) and Bearish (Red) Candles:** Define the count to match the strategy's requirements.
- **Specific Candle Characteristics:** (e.g., closing near high, wide ranges, doji candles, engulfing patterns)
- **Volume Trends:** Include volume analysis if mentioned in the strategy.
- **Price Action:** Describe specific price movements (e.g., higher highs, lower lows, sideways movement).
- **Indicator Behavior:** Detail how indicators should behave during each stage.
## Step 3: Data Generation
1. **Start Date:** Use the provided start date or default to the current year (e.g., 2024-01-01).
2. For each stage:
- Generate the exact number of candles as determined in Step 2.
- Ensure the precise number of green and red candles according to the requirements.
- For each candle:
- **Date:** Increment sequentially from the start date.
- **Open:** Previous Close + Random(1% to 20% of Previous Close)
- **High:** Max(Open, Close) + Random(1% to 20% of Max(Open, Close))
- **Low:** Min(Open, Close) - Random(1% to 20% of Min(Open, Close))
- **Close:**
- For bearish candles (red): Open - Random(1% to 20% of Open)
- For bullish candles (green): Open + Random(1% to 20% of Open)
- **Volume:** Base Volume + Random(-20% to +20%) adjusted according to the volume trend requirements of each stage.
- Adjust price movements to reflect the strategy's requirements (e.g., breakouts, pullbacks, consolidations).
- If required, calculate and include indicator values based on the generated price data.
## Step 4: JSON Compilation
1. Structure the data in the exact JSON format below:
```json
{
"candlestickData": [
{
"date": "YYYY-MM-DD",
"open": 100.00,
"high": 102.00,
"low": 99.50,
"close": 101.80,
"volume": 1000000
}
// ... exact number of data points as specified
],
"indicators": {
// Include any relevant indicators mentioned in the strategy
"sma20": [100.5, 101.2, ...],
"rsi": [45, 52, ...]
},
"explanation": "Detailed explanation here"
}
```
## Step 5: Explanation and Final Confirmation
1. **Detailed Explanation:** Provide a comprehensive explanation that includes:
- **Total Number of Candles Generated**
- **Breakdown of Candles per Stage:** (e.g., 7 candles for trend formation: 5 green, 2 red)
- **Accuracy of Bullish and Bearish Candle Counts per Stage**
- **Representation of Strategy Requirements:** How each stage aligns with the strategy.
- **Specific Patterns or Characteristics Implemented**
- **Indicator Behavior and Significance** (if applicable)
- **Key Entry and Exit Points Based on the Strategy**
- Ensure that all details in the explanation exactly match the attributes of the generated candlestick data.
2. **Data Validation and Correction:**
- **Review Generated Data:** Ensure correctness in total candle count, candle colors, and logical price movements.
- Bullish candles: Close >= Open
- Bearish candles: Close < Open
- Logical price fields: High >= Open, Close >= Low, etc.
- **Volume Trends:** Verify that volume aligns with strategy requirements.
- **Indicator Consistency:** Ensure indicator values match the generated price data.
- **Adjustments if Necessary:**
- **Modify Candle Counts:** Add or remove candles to match requirements.
- **Correct Candle Colors:** Adjust close prices to change candle colors as needed.
- **Fix Price Movements:** Ensure all price fields adhere to logical constraints.
- **Recalculate Volumes and Indicators:** Align with adjusted price data.
- **Update Explanation:** Reflect any corrections made to ensure consistency between data and explanation.
## Step 6: Final Data Confirmation
1. Perform a thorough review to ensure all aspects are accurate and compliant:
- **Candle Counts, Colors, and Patterns:** Double-check for correctness.
- **Price Movements:** Ensure they are logical and align with the strategy.
- **Volume Trends:** Confirm they match strategy requirements.
- **Indicator Values:** Verify correctness and meaningfulness.
- **JSON Structure:** Ensure it is correctly formatted and free of errors.
- **Consistency Between Data and Explanation:** Ensure the explanation fully matches and accurately describes how the data represents the given strategy.
## Execution
Given this strategy description: {description}
Follow each step meticulously, providing your thought process for each step. Ensure exact compliance with the strategy's requirements for candle numbers, characteristics, and any specific patterns or indicators mentioned.
Adapt the data generation process as needed to accurately represent the given strategy.
Summary of Changes
-
Merged Steps:
- Data Validation (Step 6) and Data Correction (Step 7) are combined into Step 5: Explanation and Final Confirmation to streamline the validation and correction processes.
- Detailed Explanation (Original Step 5) and Final Data Confirmation (Original Step 8) are integrated to ensure that explanation and final checks are cohesively handled within a single step.
-
Streamlined Instructions:
- Removed repetitive references to validation and confirmation by consolidating related tasks.
- Ensured that each step flows logically into the next without unnecessary repetition.
These modifications maintain the original prompt's comprehensive approach to generating accurate and strategy-compliant candlestick data while making the process more efficient and easier to follow.