Skip to main content
title: Winning Paths description: Provides experimental paths from signals to decisions, enhancing investment confidence through simulation and testing

draft: false

Winning Paths

To succeed in the investment market, we need to transform theoretical knowledge into practical decision-making abilities. This experiment will help you progress from identifying signals to making investment decisions through specific paths and methods, gradually improving your investment skills.

Investment Experiment Learning Path

Experiment 1: Simulating Volume-Price Signal Analysis

Volume-price relationships are important tools for identifying market trends and institutional behavior. By programming to simulate volume-price signal analysis, we can more objectively evaluate market conditions and reduce the bias of subjective judgment.

Experiment Objective

Develop a simple Python program to detect volume-price breakout signals and help identify potential institutional entry or exit timing.

Code Implementation

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# Load historical data (using sample data here; in practice, you can obtain from sources like Yahoo Finance)
# Assume we have a CSV file containing 'Date', 'Close Price', and 'Volume'
# df = pd.read_csv('stock_data.csv')

# For demonstration, we create a simulated dataset
date_range = pd.date_range(start='2024-01-01', end='2025-01-01', freq='B')
n = len(date_range)
closing_price = 100 + np.cumsum(np.random.randn(n))  # Randomly generate price data
volume = np.random.randint(100000, 1000000, n)  # Randomly generate volume data

# Artificially add some volume-price breakout signals
# Add large volume increases at several random positions
breakout_indices = np.random.choice(n, 5, replace=False)
for i in breakout_indices:
    closing_price[i] = closing_price[i-1] * (1 + np.random.uniform(0.02, 0.05))
    volume[i] = volume[i] * 3

# Create DataFrame
df = pd.DataFrame({
    'Date': date_range,
    'Close Price': closing_price,
    'Volume': volume
})

# Calculate 5-day and 20-day moving averages
df['MA5'] = df['Close Price'].rolling(window=5).mean()
df['MA20'] = df['Close Price'].rolling(window=20).mean()

# Calculate 5-day average volume and set volume anomaly threshold
df['Volume_MA5'] = df['Volume'].rolling(window=5).mean()
volume_threshold = 2  # Volume exceeding 2 times the 5-day average is considered abnormal

# Detect volume-price breakout signals
df['Volume-Price Breakout'] = False
for i in range(20, n):
    # Price breaks through 20-day MA and volume abnormally increases
    if (df['Close Price'].iloc[i] > df['MA20'].iloc[i] and 
        df['Volume'].iloc[i] > volume_threshold * df['Volume_MA5'].iloc[i]):
        df['Volume-Price Breakout'].iloc[i] = True

# Visualize results
plt.figure(figsize=(14, 7))
plt.subplot(2, 1, 1)
plt.plot(df['Date'], df['Close Price'], label='Close Price')
plt.plot(df['Date'], df['MA5'], label='5-day MA')
plt.plot(df['Date'], df['MA20'], label='20-day MA')
# Mark volume-price breakout signals
breakout_dates = df[df['Volume-Price Breakout']]['Date']
breakout_prices = df[df['Volume-Price Breakout']]['Close Price']
plt.scatter(breakout_dates, breakout_prices, color='red', marker='^', label='Volume-Price Breakout Signal')
plt.title('Price Trend and Volume-Price Breakout Signals')
plt.legend()

plt.subplot(2, 1, 2)
plt.bar(df['Date'], df['Volume'], label='Volume')
plt.plot(df['Date'], df['Volume_MA5'], color='red', label='5-day Average Volume')
plt.title('Volume and Average Volume')
plt.legend()

plt.tight_layout()
plt.show()

# Output dates when volume-price breakout signals occurred
print("Dates when volume-price breakout signals occurred:")
print(df[df['Volume-Price Breakout']][['Date', 'Close Price', 'Volume']])

Volume-Price Signal Analysis Process

Experiment Explanation

  1. Data Preparation: The program first loads or generates historical price and volume data for stocks
  2. Indicator Calculation: Calculates 5-day and 20-day moving averages, as well as the 5-day average of trading volume
  3. Signal Detection: Marks as a volume-price breakout signal when the price breaks through the 20-day moving average and trading volume exceeds twice the 5-day average
  4. Result Visualization: Intuitively displays price trends, moving averages, and volume-price breakout signals through charts
In practical applications, you can adjust parameters according to your needs, such as the period of moving averages, the threshold for volume anomalies, etc. You can also add more technical indicators, such as Relative Strength Index (RSI), Bollinger Bands, etc., to improve signal accuracy.

Volume-Price Breakout Signal Detection Process

Experiment 2: A/B Testing Take-Profit Strategies

Take-profit strategies are one of the key factors for investment success. Through A/B testing, we can compare the effects of different take-profit strategies and find the most suitable method for ourselves.

Experiment Objective

Compare the performance of two common take-profit strategies in simulated trading: fixed percentage take-profit and trailing take-profit.

Introduction to Take-Profit Strategies

Sell all or part of the holdings when the investment return reaches a preset percentage (such as 15%, 20%, or 30%).

Advantages

  • Simple and clear, easy to execute
  • Can ensure a certain level of profit
  • Avoid profit retracement caused by greed

Disadvantages

  • May sell too early and miss larger upward opportunities
  • May be triggered frequently in volatile markets

Experiment Steps

1

Prepare Test Data

Select historical data of multiple stocks as test samples, covering different industries and market environments
2

Set Test Parameters

  • Fixed percentage take-profit: Set different take-profit percentages (such as 10%, 15%, 20%, 25%, 30%)
  • Trailing take-profit: Set different retracement percentages (such as 3%, 5%, 8%, 10%)
  • Initial capital: 100,000 yuan
  • Transaction costs: Commission 0.025%, stamp duty 0.1%
3

Simulate Trading Process

For each stock and each take-profit strategy, perform the following simulation:
  1. Buy stocks at random time points
  2. Apply the take-profit strategy, record selling time and returns
  3. Calculate final return rate and win rate
4

Analyze Test Results

Compare the performance of different take-profit strategies, including:
  • Average return rate
  • Win rate (percentage of profitable trades)
  • Trading frequency
  • Maximum drawdown
5

Optimize Strategy Parameters

Adjust parameters of take-profit strategies based on test results to find the optimal combination

Experiment Result Example

The following are the simulation test results using 2024 historical data of 5 stocks (Kweichow Moutai, Tencent Holdings, Alibaba, Contemporary Amperex Technology, BYD):

Fixed 15% Take-Profit

Average return rate: 12.8%, Win rate: 68%, Trading frequency: 0.8 times/month

Fixed 25% Take-Profit

Average return rate: 19.5%, Win rate: 52%, Trading frequency: 0.4 times/month

Trailing 5% Take-Profit

Average return rate: 15.6%, Win rate: 61%, Trading frequency: 0.6 times/month

Trailing 10% Take-Profit

Average return rate: 21.3%, Win rate: 48%, Trading frequency: 0.3 times/month
Conclusion: From the test results, although the trailing 10% take-profit strategy has a slightly lower win rate, it has the highest average return rate; the fixed 15% take-profit strategy achieves a good balance between return rate and win rate. In actual investment, you can choose a suitable take-profit strategy based on personal risk preference and market environment.

Take-Profit Strategy Comparison Analysis

Experiment 3: Building a Personal Investment System

Integrating the knowledge and methods learned earlier to build an investment system suitable for yourself is a crucial step from novice to mature investor.

Core Components of an Investment System

  • Macroeconomic analysis (GDP, CPI, PMI and other indicators)
  • Market sentiment assessment (trading volume, margin financing and securities lending balance, investor sentiment index, etc.)
  • Technical analysis (market index trends, moving average systems, trading volume changes, etc.)
  • Fundamental screening (financial indicators, industry position, competitive advantages, etc.)
  • Technical screening (volume-price relationships, trend strength, relative strength, etc.)
  • Valuation analysis (P/E, P/B, PEG and other valuation indicators)
  • Entry signal confirmation (breakout, retracement, reversal and other technical signals)
  • Position management (single position size, total position control)
  • Staged buying plan (price range, time interval, etc.)
  • Take-profit strategies (fixed percentage, trailing take-profit, etc.)
  • Stop-loss strategies (percentage stop-loss, technical level stop-loss, etc.)
  • Position adjustment (gradual reduction, liquidation conditions, etc.)
  • Diversification (industry, region, asset class, etc.)
  • Capital management (total risk exposure, maximum drawdown control, etc.)
  • Hedging strategies (used in high-risk periods)
  • Trading journal (record the decision-making process and results of each trade)
  • Regular review (analyze the reasons for success and failure)
  • System optimization (adjust strategies based on market changes and experience)

Steps to Build an Investment System

  1. Clarify Investment Goals: Determine your investment goals (such as long-term wealth growth, short-term returns, retirement planning, etc.) and risk tolerance
  2. Learn and Research: Systematically learn investment theories and methods, understand different investment strategies and tools
  3. Develop Initial Framework: Based on your goals and preferences, develop the basic framework of your investment system
  4. Simulate and Test: Verify the effectiveness of the investment system through simulated trading or small position testing
  5. Optimize and Perfect: Continuously optimize and perfect the investment system based on test results and market changes
  6. Strictly Execute: Strictly execute the investment system in actual investment and avoid emotional decision-making

Experiment Task: Create Your Investment Journal

A good investment journal can help you record the investment process, analyze decision-making effects, and continuously improve your investment level. Now, let’s create a standardized investment journal template.

Investment Journal Template

Investment JournalBasic Information
Date: 2025-03-15
Market Environment: Consolidating downward
Investment Objective: Medium-term (3-6 months)
Target Analysis
Stock Code: 600519 (Kweichow Moutai)
Industry: Food and Beverage
Buying Reasons:

Reasonable valuation (P/E 28x, lower than historical average)
Stable fundamentals (continuous growth in revenue and profits)
Technical signs of stabilization (shrinking volume and stabilization, MACD golden cross)


Risk Factors:

Macroeconomic downward pressure
Intensifying industry competition


Trading Plan
Buying Price Range: 1650-1700 yuan
Buying Position: 10% of total funds
Stop-Loss Point: 1530 yuan (7% decline)
Take-Profit Target: 2000 yuan (18% increase) or use trailing take-profit
Actual Trading Record
Buying Date: 2025-03-16
Buying Price: 1680 yuan
Buying Quantity: 50 shares
Total Cost: 84,000 yuan
Follow-up Tracking
2025-03-20: Price 1720 yuan, up 2.38%, continue holding
2025-03-25: Price 1780 yuan, up 5.95%, approaching target, consider partial profit-taking
2025-04-01: Price 1850 yuan, up 10.12%, sell 20 shares, lock in partial profits
2025-04-10: Price 1980 yuan, up 17.86%, sell all, complete trade
Trading Summary
Final Return Rate: 17.86%
Successful Experience: Strictly executed trading plan, sold in batches when approaching target
Areas for Improvement: Could consider appropriately relaxing take-profit targets when fundamentals remain unchanged
Lessons Learned
When market volatility is high, staged buying and selling can effectively reduce risk
Fundamental analysis is the basis for long-term investment, while technical analysis can help grasp entry timing
Strict risk control is the key to investment success
Investment is a process of continuous learning and progress. Through systematic experiments and practice, you can gradually improve your investment skills and find a winning path suitable for yourself. Remember, successful investment requires a combination of knowledge, discipline, and patience.