SuperAPI AI Directory

macd-trend-resonance-stock-picker

General & other

View repository

Updated 10-16 06:52

About this skill

MACD Trend Resonance Stock Selection Skill

Output Objectives

Turn "moving averages for trend, MACD for rhythm" into an executable stock selection process, outputting:

  1. Sample pool and timestamp
  2. Trend direction judgment
  3. MACD momentum state
  4. Candidate stock grading
  5. Entry triggers and invalidation conditions
  6. Risk warnings and do-not-trade list

Data and Tool Requirements

  • A-share data must be obtained preferentially through ../a-share-skill/scripts/ , switching to unverified data sources is prohibited.
  • Use by default:
    • fetch_realtime.py to obtain real-time snapshots
    • fetch_history.py to obtain daily/60-minute K-lines
    • fetch_technical.py to obtain technical indicators such as MACD and moving averages
    • fetch_stock_events.py to obtain background on major events and unusual movements
  • When any key field is missing, explicitly write "missing/low confidence"; filling in guesses is prohibited.

Standard Workflow

Step 1: Define the sample pool and analysis scope

First clarify:

  • User-specified symbols, sectors, index constituents, or the whole market
  • Analysis period, default 日线定方向 + 60分钟找触发
  • Timestamp and sample size

If the user did not give a scope:

  • Default scope is tradable Shanghai and Shenzhen A-share samples
  • If the task is "screen stocks within a sector", first use the sector's constituents as the sample pool

Step 2: First use moving averages to determine direction; do not screen stocks against the trend

Core rules:

  • 60日线向上 + 收盘价在60日线上方 → trend qualified
  • 60日线走平或粘合 → observe only, do not list as a strong candidate
  • 60日线向下 + 收盘价在60日线下方 → eliminate directly

Supplementary observations:

  • Whether the 20-day line is above the 60-day line
  • Whether the 20-day line and 60-day line are both rising
  • Whether higher highs and higher lows have still been maintained over the most recent 5 to 10 trading days

Direction is a hard filter condition. If the direction is wrong, no matter how beautiful the subsequent MACD is, it cannot enter the strong candidate pool.

Step 3: Then use MACD to determine rhythm; only look for timing within the trend

Priority from high to low:

  1. MACD 位于 0 轴上方金叉
  2. 红柱缩短后重新放大
  3. DIF/DEA 同步向上
  4. 60分钟 MACD 与日线同向

Downgrade or elimination conditions:

  • If the daily MACD is below the 0 axis, it may only be listed for observation, not as a main buy candidate
  • Clear top divergence: downgrade or remove from the candidate pool
  • If a golden cross occurs in an obvious downtrend, treat it only as a rebound, not as the starting point of a main upward move

Step 4: Build four tiers of candidate grading

Grade A, strong resonance between trend and rhythm

Simultaneously satisfy:

  • 60-day line is rising
  • Stock price stands above the 60-day line
  • Daily MACD is above the 0 axis
  • A golden cross has recently appeared or the red bars have expanded for a second time
  • The 60-minute timeframe at least does not hold it back, and preferably has a synchronized golden cross

Action:

  • Enter the key watch/executable pool
  • Execute when a pullback does not break support or when there is an intraday volume breakout

Grade B, trend is correct, rhythm has just turned strong

Satisfies trend conditions, and at the same time:

  • Daily MACD is approaching or has just returned above the 0 axis
  • Red bars have begun to recover, but confirmation is average
  • The 60-minute timeframe turns strong before the daily timeframe

Action:

  • May try with a light position
  • Wait for a clearer trigger, such as breaking the prior high or volume expansion

Grade C, trend is acceptable, but the rhythm is contradictory

Such as:

  • Moving averages are bullish, but MACD shows a bearish divergence or a death cross
  • MACD golden cross, but still below the 0 axis

Action:

  • Observe only
  • Do not give active buy-chasing advice

Grade D, avoid directly

Any one hit:

  • The 60-day line is trending downward
  • The stock price continues to trade below the 60-day line
  • MACD continues to weaken after a death cross
  • The sector itself is significantly weak and lacks an independent logic

Action:

  • AVOID

Step 5: Buy point design, only use verifiable triggers

By default, only give "conditional trigger-based" buy points, and do not act early based on subjective feeling.

Priority triggers:

  • Break above the high of the recent 5 to 10 day platform
  • Pull back to the 20-day/60-day moving average, stabilize, then rise again
  • Daily trend is upward, with a 60-minute MACD golden cross resonance
  • Break above yesterday's high/stage high with increased volume

Every time, must give:

  • Trigger condition
  • Stop-loss level
  • Invalidation condition

Common invalidation definitions:

  • Fall back below the 60-day line
  • Break below the low of the trigger candle
  • DIF turns down again and breaks below DEA, and volume weakens

Step 6: Sell points and position reduction rules

Priority position reduction signals:

  • The trend is not broken, but MACD shows a bearish divergence
  • The red bars continue to shorten, and momentum decays
  • The 60-minute chart death-crosses first, and the daily chart follows and weakens

Direct exit signals:

  • The stock price effectively breaks below the 60-day line
  • Daily MACD breaks below the 0 axis, and the trend simultaneously deteriorates
  • The breakout fails and the price falls back with increased volume

Step 7: Sector and market filtering, avoid looking at individual stocks in isolation

Before concluding on an individual stock, at least also check:

  • Whether the sector it belongs to is in an upward phase or a period of strengthening rotation
  • Whether the broader market supports trend stocks continuing to play out
  • Whether there are event risks such as financial reports, regulation, share reductions, or trading suspensions

If the sector and index are clearly headwind:

  • Downgrade the candidate rating by at least one level
  • Do not give heavy-position advice

Recommended scoring framework (100 points)

  • Trend direction, 40 points
    • 60-day line direction, 20 points
    • Stock price position relative to the 60-day line, 10 points
    • 20/60-day line bullish structure, 10 points
  • MACD rhythm, 35 points
    • Whether it is above the 0 axis, 15 points
    • Whether there is a golden cross/red bars expand again, 10 points
    • Whether the 60-minute chart is synchronized, 10 points
  • Sector and market environment, 15 points
  • Risk control and event cleanliness, 10 points

Action mapping:

  • 85-100:EXECUTE
  • 70-84:LIGHT
  • 55-69:OBSERVE
  • <55:AVOID

Conflict handling rules

  • Strong moving averages, weak MACD: observe rhythm repair first, do not rush to chase.
  • Strong MACD, weak moving averages: view it as a rebound, not as a main upward wave.
  • Strong stock, weak sector: reduce position size and expectations.
  • Signals look good but volume does not confirm: do not upgrade the rating.
  • If any key data is missing: clearly mark low confidence, do not output strong conclusions.

Output template

Output according to the following structure:

  1. Target scope and timestamp
  2. Sample pool screening results (how many enter A/B/C/D)
  3. Grade A candidates
    • Code/Name
    • Trend basis
    • MACD basis
    • Trigger condition
    • Invalidation condition
  4. Grade B candidates
  5. Typical features to avoid
  6. Conclusion: Is it currently more suitable for trend following with light positions for trial and error, or to continue waiting

One-sentence principle

  • Look at the moving averages first, then at MACD.
  • Determine the direction first, then find the rhythm.
  • If the direction is wrong, no matter how good the rhythm is, do not take a heavy position.
  • Without a trigger, it does not count as a buy point.