Làm sao từ một description mô tả biểu đồ hình nến viết được một prompt template bằng Tiếng Anh theo phương pháp chain of thought để tạo mock data phản ánh chính xác mô tả biểu đồ (đúng số lượng và màu sắc mỗi giai đoạn), đảm bảo tổng quát với mọi strategy hay thế của biểu đồ hình nến. Đầu ra có yêu cầu như sau: json {{ "candlestickData": [ {{ "date": "2024-01-01", "open": 100.00, "high": 102.00, "low": 99.50, "close": 101.80, "volume": 1000000 }}, {{ "date": "2024-01-02", "open": 101.90, "high": 103.50, "low": 101.70, "close": 103.30, "volume": 1100000 }}, // ... exact number of data points as specified in the description ], "explanation": "Detailed explanation of how the generated data matches the input description, highlighting key features and patterns. Total number of candles generated: [X], which includes [Y] candles for the leg ([A] green, [B] red), [Z] candles for consolidation ([C] green, [D] red), and 1 entry candle, as per the description." }} Ví dụ về mô tả: description = """Setup Name: Continuation breakout
Strategy Type: Breakout
Timeframe: Daily chart
Description:
1. A leg of 3-5 daily candles, each candle has close near high, the range between the close and open is larger than normal
2. A period of 3-5 daily candles (yellow mark), of very narrow range (Doji), where the range between high to low is smaller than normal
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 """
Assistant
Certainly! Below is an English prompt template that leverages the Chain of Thought method to generate mock candlestick data based on a detailed chart description. This template ensures that the generated data accurately reflects the specified number of candles, their colors, and other key characteristics, making it adaptable to various candlestick strategies.
Prompt Template
markdown
You are an expert in financial chart analysis and data generation. Using the following description of a candlestick chart, generate mock candlestick data that accurately reflects the description. Follow a step-by-step reasoning process (Chain of Thought) to ensure that the number of data points, their colors (green for bullish candles and red for bearish candles), and other specified features align precisely with the description. The generated data should be general enough to accommodate any strategy or variation within candlestick charts.
**Description:**
[Insert your candlestick chart description here]
code
**Instructions:**
1. **Analyze the Description:** Break down the description to identify key components such as the number of candle legs, consolidation periods, entry candles, color requirements, and any specific criteria mentioned.
2. **Determine Candle Counts and Characteristics:**
- Identify the total number of candles to generate.
- Determine the number of green and red candles in each segment (e.g., legs, consolidation).
- Note any special conditions like doji candles or specific closing positions.
3. **Generate Mock Data:**
- For each candle, generate realistic values for `date`, `open`, `high`, `low`, `close`, and `volume` that align with the described behavior.
- Ensure that the `close` price reflects the required position (e.g., near high or low).
4. **Construct the JSON Output:**
- Populate the `candlestickData` array with the generated candle objects.
- Provide a comprehensive `explanation` that details how each part of the generated data matches the description, including counts and color distributions.
**Output Format:**
```json
{
"candlestickData": [
{
"date": "2024-01-01",
"open": 100.00,
"high": 102.00,
"low": 99.50,
"close": 101.80,
"volume": 1000000
},
{
"date": "2024-01-02",
"open": 101.90,
"high": 103.50,
"low": 101.70,
"close": 103.30,
"volume": 1100000
}
// ... additional candle objects as specified
],
"explanation": "Detailed explanation of how the generated data matches the input description, highlighting key features and patterns. Total number of candles generated: [Total], which includes [Number] candles for the leg ([Green] green, [Red] red), [Number] candles for consolidation ([Green] green, [Red] red), and 1 entry candle, as per the description."
}
Example Usage:
Given the following description:
code
Setup Name: Continuation Breakout
Strategy Type: Breakout
Timeframe: Daily chart
Description:
1. A leg of 3-5 daily candles, each candle has close near high, the range between the close and open is larger than normal
2. A period of 3-5 daily candles (yellow mark), of very narrow range (Doji), where the range between high to low is smaller than normal
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
The generated output would look like:
json
{
"candlestickData": [
{
"date": "2024-01-01",
"open": 100.00,
"high": 102.00,
"low": 99.50,
"close": 101.80,
"volume": 1000000
},
{
"date": "2024-01-02",
"open": 101.90,
"high": 103.50,
"low": 101.70,
"close": 103.30,
"volume": 1100000
},
// ... exact number of data points as specified in the description
],
"explanation": "Total number of candles generated: 9, which includes 4 candles for the leg (3 green, 1 red), 4 candles for consolidation (all doji), and 1 entry candle, as per the description. Each leg candle closes near its high with a larger range between close and open, consolidation candles have very narrow ranges, and the entry candle closes near the high with increased volume."
}
Notes:
Replace [Insert your candlestick chart description here] with your specific chart description.
Ensure that the number of candles and their attributes strictly adhere to the details provided in the description.
The explanation field should dynamically reflect the characteristics of the generated data, adjusting counts and classifications as necessary.
This template provides a structured approach to generating accurate and descriptive mock candlestick data based on any given strategy or chart description. By following the Chain of Thought method, it ensures thorough analysis and precise data generation tailored to the specified criteria.