Skip to main content

Improved Sorting Prompt

· 4 min read
Max Kaido
Architect

Below are three improved prompt formulations. Each clarifies the trading criteria (e.g., RSI thresholds, MACD crossing specifics, ADX ranges), comparison logic (e.g., how to pick a "winner"), and exact JSON response format, so that different AI models have less room for misinterpretation or data mix-ups.


Prompt Alternative 1: Clear Technical Thresholds

SWING TRADE SIGNAL:
We want to identify markets that meet these technical criteria on a 4-hour chart:
1) RSI recovering from oversold (i.e., RSI crossing above 40–50 range),
2) MACD crossing upwards (MACD histogram > 0 and MACD line crossing above signal line),
3) Price has recently broken above its Bollinger Bands after a period of consolidation,
4) Volume trending upwards for the last several 4-hour candles,
5) ADX value above 25 to confirm a strong directional trend,
6) Evidence of multi-period volatility compression prior to the breakout,
7) Price trading near or above Ichimoku cloud support.

Given two markets (with JSON data for RSI, MACD, ADX, ATR, Ichimoku, etc.), compare and decide which has a *stronger* bullish swing-trade setup. Then output a single JSON response:

{
"winner": "symbol_of_stronger_market",
"loser": "symbol_of_weaker_market",
"confidence": 0.0–1.0,
"reasoning": "Explain how each technical criterion was met or missed by each market. Highlight RSI, MACD confirmation, ADX, and Ichimoku positioning in your reasoning. Be factual and avoid labeling RSI near 60 as oversold or oversold as above 40–50.",
"timestamp": "current ISO timestamp"
}

Important notes:
- Only declare a market as having an actual MACD crossover if `trend_confirmation = true`.
- For RSI, mention "recovering from oversold" only if the prior data is below 40 and current RSI is climbing above 40–50.
- For ADX, interpret 25–35 as "strong trend" and 20–25 as "moderate trend," etc.

Why This Helps:

  • Explicit RSI range for "oversold" clarifies that ~60 is not oversold.
  • Defines MACD crossing to reduce confusion about histogram vs. signal.
  • Establishes ADX numeric thresholds so the model doesn't mix up "strong" vs. "moderate."
  • Encourages referencing only factual details from the JSON (like trend_confirmation).

Prompt Alternative 2: Step-by-Step Evaluation Criteria

INSTRUCTIONS FOR COMPARING TWO MARKETS (4H CHART DATA):

1. Check if RSI has moved from a previously low level ([40) to a current value ]50.
2. Verify MACD crossover: MACD line above signal line with a positive histogram; confirm "trend_confirmation" from the JSON.
3. Confirm price break above Bollinger Bands post-consolidation: use the provided BB breakout flag or mention if missing.
4. Examine volume trends: Has volume been consistently higher over the last few candles?
5. Evaluate ADX: Above 25 indicates a strong trend, 20–25 is moderate, [20 is weak.
6. Look at volatility compression: If provided, note if ATR or "volatility_ratio" indicates prior low volatility that's now expanding.
7. Ichimoku: Confirm if the price is supported by or above the cloud.

After evaluating each point, pick the market that better meets *all or most* of these conditions. Output exactly:

{
"winner": "[symbol]",
"loser": "[symbol]",
"confidence": [0 to 1],
"reasoning": "[detailed step-by-step explanation]",
"timestamp": "[current ISO 8601 date/time]"
}

Additional Requirements:
- In your reasoning, address each criterion (1–7) for both markets using the actual JSON fields.
- Do not label RSI near 60 as oversold; only call it oversold if it's below 40.
- Ensure ADX interpretation is consistent with the numeric value provided (e.g., 29 = "strong").
- Avoid contradictory statements: e.g., do not claim a market's ADX is both high and low simultaneously.

Why This Helps:

  • A step-by-step approach forces the model to address each metric in turn, reducing confusion.
  • Clear numeric guidelines for RSI and ADX.
  • Instructs how to finalize a single winner vs. loser based on how many criteria are met.

Prompt Alternative 3: Strict JSON Field Handling & Data Integrity Checks

Compare the following JSON data for two markets (Market A, Market B). Each market has the fields:
- rsi (float),
- macd { value, signal, histogram, crossover (0 or 1), trend_confirmation (true/false) },
- trend { adx (float), strength, description },
- volatility { atr, atr_sma, volatility_ratio, is_volatile, volatility_state },
- ichimoku { ... },
- plus any notes on Bollinger Bands or volume.

We want a single final comparison to identify the best 4H swing-trade candidate based on:
1) RSI crossing above ~50 after previously being under ~40 (recovery from oversold),
2) MACD crossing up (check `trend_confirmation` == true),
3) Bollinger Band breakout post-consolidation,
4) Increasing volume pattern over the last few candles,
5) ADX ≥ 25 for "strong" trend,
6) Volatility compression expanding (if `volatility_ratio` ] 1, or other relevant fields),
7) Ichimoku support (price near or above the cloud).

**Output** strictly in JSON format with these keys:
{
"winner": "symbol",
"loser": "symbol",
"confidence": 0–1,
"reasoning": "Explain each criterion's pass/fail, referencing numeric values (e.g., ADX 29 vs 22.9). Avoid calling 60 RSI oversold.",
"timestamp": "current ISO 8601 timestamp"
}

Important:
- Do not invert numeric values.
- If ADX=29, that is stronger than ADX=22.
- If MACD trend_confirmation is false, do not claim it's crossing up.
- If RSI is ~59–60, do not call it 'oversold.'
- Provide the logic for your final "winner" vs. "loser" decision clearly.

Why This Helps:

  • Encourages data consistency by explicitly warning against numeric mix-ups.
  • Emphasizes referencing exact fields from each market's JSON.
  • States minimum RSI and ADX thresholds plainly.
  • Mandates a strict JSON response with an explicit caution to avoid contradictory claims.

Final Note

All three improved prompt versions:

  • Clarify how to interpret indicators,
  • Specify numeric thresholds for RSI (oversold vs. neutral) and ADX (strong vs. moderate),
  • Demand consistent references to the actual JSON data,
  • Provide a final JSON output with no extraneous text.

Such refinements greatly reduce the likelihood of contradictory or incorrect answers from AI models.