Hãy thiết kế 3 prompt template bằng Tiếng Anh: 1 prompt phân tích mô tả, xác định Stage Identification and Adaptation, 1 prompt tạo ra mock data, 1 prompt đánh giá mock data tạo ra và chỉnh sửa nếu không đúng mô tả, phân tích, và đưa ra lời giải thích cuối cùng. 3 prompt này theo thứ tự lần lượt , mục đích là từ mô tả biểu đồ hình nến cuối cùng sẽ đưa ra được mock data biểu diễn chính xác số nến, số nến cho mỗi màu ở mỗi giai đoạn, volume chính xác theo mô tả, phù hợp với tất cả các thế, strategy, trong biểu đồ hình nến. Hãy định dạng đúng đầu ra của mỗi prompt để nó có thể truyền liên tiếp nhau. Các ví dụ về mô tả volume: volume relatively to price range: large price range với volume nhỏ, small price range nhưng volume lớn, declining volume to the right side, increasing volume to the right side, random volume. e cứ tưởng tượng, volume là fuel, price range là quãng đường. Khi nhiều fuel thì range phải rộng. khi ít fuel thì quãng đường đi được phải ít. Nhưng ngoài thực tế thì có ma sát, đường xấu, tốt... Nên đôi khi có lúc fuel ít, quãng đường lại đi được nhiều, (do ít sellers). Có khi fuel nhiều, quãng đường lại đi được ít (do nhiều sellers)
thế nên mình phải prompt làm sao đó để cái volume nó hơi imperfect 1 chút
1 trường hợp thực tế của setup mình đang làm, e để ý cái volume nó ko "artificial" mà nó lên xuống phập phồng, nhưng rất logic (cho người hay đọc charts). Chú ý yếu tố imperfect chỉ dành cho volume, còn các yếu tố khác phải đảm bảo thật chính xác! Prompt thật kỹ càng, chi tiết từng bước để 1 mô hình ngôn ngữ yếu vẫn có thể thực thi một cách chính xác, tổng quát cho mọi trường hợp, sử dụng phương pháp Chain of Thought. Ví dụ về đầu ra cuối cùng: ```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, ...]
}}
}}
Ví
Assistant
Setup Name: Continuation breakout
Strategy Type: Breakout
Timeframe: Daily chart
Description:
1. A leg of 3-10 daily candles, 75% are the green candles close near high. the range between the close and open is larger than normal. 25% candles are bearish, or small narrow range candle.
2. A period of 3-5 daily candles in consolidation. The candles can be small range. Declining volume to the right side
3. A big daily candle, close near high, as the entry candle
Setup Criteria 2LYNCH:
(2): Not up 2 days in a row - Before the entry day, the previous 2 days should not have positive net change. Net change of a candle is calculated by its closing price toward the previous candle’s closing price.
(L): Linearity - The leg (description 1.) should have more green candles than red candle, and not many wicks
(N): Narrow - Before the entry day, the previous day should be a doji or a red candle, not a green candle
(C): Consolidation - The pullback (description 2.) should be tight, compact, in low declining volume
(H): High: the entry candle at the close, should have closing price near the high of day """
Certainly! Below are three detailed English prompt templates designed to work sequentially for analyzing a candlestick chart description, generating mock data, and evaluating that data. Each prompt is carefully structured to ensure accurate and coherent outputs, facilitating a smooth handoff between each stage.
Prompt 1: Analysis and Stage Identification
Purpose:
Analyze the provided candlestick chart description to identify and delineate the different stages, including identifying key characteristics and criteria for each stage. This analysis will serve as the foundational understanding for subsequent mock data generation.
Template:
markdown
You are a financial market analyst with expertise in technical analysis and candlestick chart patterns. Your task is to analyze the following candlestick chart description, identify the distinct stages, and outline the specific characteristics and criteria for each stage.
**Description:**
"""
{DESCRIPTION_TEXT}
"""
**Instructions:**
1. **Stage Identification:** Break down the description into its constituent stages or phases. For each stage, provide a clear and concise title.
2. **Stage Characteristics:** For each identified stage, list the key characteristics, including:
- Number of candles
- Candle colors (e.g., bullish/green, bearish/red)
- Candle patterns (e.g., doji, consolidation)
- Price range behaviors (e.g., close near high, narrow range)
- Volume behavior related to price range (e.g., declining, increasing, random)
3. **Criteria Specifications:** Detail any specific criteria or conditions that must be met for each stage to qualify according to the description.
4. **Overall Strategy Context:** Explain how these stages fit into the overall trading strategy or pattern being described.
**Output Format:**
Provide your analysis in a structured format as shown below:
```json
{
"stages": [
{
"stageNumber": 1,
"stageTitle": "Stage Title",
"characteristics": {
"numberOfCandles": "e.g., 3-10",
"candleColors": "e.g., 75% green, 25% red",
"candlePatterns": "e.g., close near high, narrow range",
"priceRangeBehavior": "e.g., larger than normal",
"volumeBehavior": "e.g., declining to the right side"
},
"criteria": "Detailed criteria for this stage."
},
{
"stageNumber": 2,
"stageTitle": "Stage Title",
"characteristics": {
// Similar structure as above
},
"criteria": "Detailed criteria for this stage."
},
// Add additional stages as necessary
],
"strategyContext": "Explanation of how the stages integrate into the overall strategy."
}
Example Usage:
If provided with the variation_consolidation_2A description, your analysis should identify stages such as "Initial Leg," "Consolidation Phase," and "Entry Candle," detailing their specific characteristics and how they contribute to the continuation breakout strategy.
Prompt 2: Mock Data Generation
Purpose:
Generate realistic mock candlestick data based on the analyzed stages from Prompt 1. The data should accurately reflect the number of candles, their colors, price ranges, and incorporate slightly imperfect volume values to mimic real market conditions.
Template:
markdown
You are a data scientist specializing in financial markets. Your task is to generate mock candlestick data based on the following stage analysis. The data should include realistic variations in volume while ensuring all other aspects strictly adhere to the provided characteristics and criteria.
**Stage Analysis:**
"""
{STAGE_ANALYSIS_JSON}
"""
**Instructions:**
1. **Data Structure:** Create a JSON object containing two main sections:
- `candlestickData`: An array of candlestick entries.
- `indicators`: An object containing arrays of indicator values as specified (e.g., SMA, RSI).
2. **Candlestick Data:**
- **Date:** Assign sequential dates starting from a specified start date (e.g., "2023-01-01"). Ensure the number of entries matches the total number of candles described in all stages.
- **Open, High, Low, Close Prices:** Generate prices that reflect the described price behaviors for each stage. Ensure that:
- Green candles have a closing price higher than the opening price.
- Red candles have a closing price lower than the opening price.
- Price ranges (high - low) align with the stage's price range characteristics.
- **Volume:** Assign volume values based on the price range, introducing slight imperfections as described (e.g., not always strictly proportional to range). Use realistic volume figures to simulate market conditions.
3. **Indicators:**
- Calculate relevant indicators mentioned in the stage analysis (e.g., SMA20, RSI).
- Ensure indicator values are consistent with the generated price data.
4. **Volume Imperfections:**
- Implement slight randomness in volume relative to price range to mimic real market imperfections.
- Ensure that:
- Generally, larger price ranges have higher volumes, but occasionally, smaller ranges may have higher volumes due to fewer sellers.
- Conversely, larger volumes may sometimes correspond to smaller price ranges if there is significant selling pressure.
**Output Format:**
Provide the mock data in the following JSON structure:
```json
{
"candlestickData": [
{
"date": "YYYY-MM-DD",
"open": 100.00,
"high": 102.00,
"low": 99.50,
"close": 101.80,
"volume": 1000000
},
// ... additional candlestick entries
],
"indicators": {
"sma20": [100.5, 101.2, /* ... */],
"rsi": [45, 52, /* ... */]
// Include other indicators as specified
}
}
Additional Notes:
Ensure all numerical values are realistic and consistent with typical market data.
Dates should be in ISO format and sequential without gaps.
The number of entries in candlestickData should precisely match the total number of candles defined across all stages.
Indicators should have the same number of data points as candlestickData, aligned by date.
Prompt 3: Mock Data Evaluation and Refinement
Purpose:
Evaluate the generated mock candlestick data to ensure it accurately reflects the initial stage analysis. Specifically, verify that the volume data incorporates the intended imperfections while all other data strictly adhere to the described criteria. Modify the data if discrepancies are found and provide explanations for any changes made.
Template:
markdown
You are a quality assurance analyst for financial data simulations. Your task is to evaluate the following mock candlestick data to ensure it aligns with the initial stage analysis. Pay special attention to the volume data, ensuring it includes realistic imperfections as specified, while all other aspects strictly adhere to the described criteria.
**Stage Analysis:**
"""
{STAGE_ANALYSIS_JSON}
"""
**Mock Data:**
"""
{MOCK_DATA_JSON}
"""
**Instructions:**
1. **Data Verification:**
- **Candlestick Integrity:** Ensure that each candlestick entry meets the criteria outlined in each stage:
- Correct number of candles per stage.
- Accurate candle colors (green for bullish, red for bearish).
- Proper price ranges and positions (e.g., close near high for certain candles).
- **Volume Assessment:**
- Verify that volume generally correlates with price ranges as intended.
- Identify any instances where volume does not align with the expected relationship to price range.
- Ensure that imperfections (e.g., smaller ranges with higher volumes and vice versa) are present and logically justified.
2. **Data Refinement:**
- **If Discrepancies Found:**
- Modify only the `volume` values to correct any inconsistencies.
- Ensure that adjustments introduce slight imperfections without violating the overall relationship between volume and price range.
- **Preserve Data Integrity:**
- Do not alter `open`, `high`, `low`, or `close` values unless they violate the stage criteria.
- Maintain the chronological order and consistency of indicators with the candlestick data.
3. **Explanation:**
- For each modification made, provide a clear explanation detailing:
- What the discrepancy was.
- How and why the change was made to rectify it.
- How the change maintains realistic market conditions.
**Output Format:**
Provide the refined mock data along with explanations in the following format:
```json
{
"refinedMockData": {
"candlestickData": [
{
"date": "YYYY-MM-DD",
"open": 100.00,
"high": 102.00,
"low": 99.50,
"close": 101.80,
"volume": 1005000 // Adjusted volume if needed
},
// ... additional candlestick entries
],
"indicators": {
"sma20": [100.5, 101.2, /* ... */],
"rsi": [45, 52, /* ... */]
// Include other indicators as specified
}
},
"modifications": [
{
"date": "YYYY-MM-DD",
"fieldChanged": "volume",
"originalValue": 1000000,
"newValue": 1005000,
"reason": "Volume was too high for a small price range; adjusted to introduce realistic imperfection."
},
// ... additional modifications if any
],
"finalExplanation": "Summary of all changes made and confirmation that the refined mock data now accurately reflects the stage analysis with realistic volume imperfections."
}
Final Remarks:
Ensure that all modifications enhance the realism of the mock data without deviating from the core stage characteristics.
The explanation should provide sufficient context for each change, demonstrating adherence to the initial description and rational market behavior.
Usage Workflow:
Start with Prompt 1:
Input your candlestick chart description into {DESCRIPTION_TEXT} to receive a structured stage analysis.
Proceed to Prompt 2:
Take the stage analysis JSON output from Prompt 1 and input it into {STAGE_ANALYSIS_JSON} to generate the initial mock candlestick data.
Move to Prompt 3:
Use both the stage analysis and mock data JSON outputs from Prompts 1 and 2, respectively, to evaluate and refine the mock data, ensuring accuracy and realism.
By following this sequential approach, you can accurately transform a textual candlestick chart description into realistic mock data suitable for analysis, testing, or simulation purposes.