Commit ·
2c5d02a
1
Parent(s): eb4ef03
Simplify Strategist prompt: concrete example instead of rule-chain
Browse filesThe previous prompt enumerated so many constraints that Qwen3-14B
loaded them into its deliberation loop and never actually produced
the final structured line, causing parse failures. This version shows
one concrete filled example (AAPL BUY 75% $289 $283 $298) and tells
the model to substitute; the literal example also primes it to emit
concrete numbers in the same shape instead of the 'ACTION / XX%'
placeholders it was echoing back.
The sanity-fix in the parser still corrects runaway numbers if they
slip through.
90 unmodified lines91929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312490 unmodified linesreturn Task(description=(f"Synthesize all analysis for {ticker} into a final trading signal. "f"Consider the market conditions, fundamental valuation, technical signals, "f"and risk parameters. Produce a clear BUY, SELL, or HOLD recommendation "f"with a confidence percentage.\n\n"f"CRITICAL PRICE RULES — check each value before you output it:\n"f" * Use the CURRENT PRICE reported by the Market Scanner's "f" get_price_change tool as the basis for Entry. Do NOT invent a "f" price from memory.\n"f" * For a BUY recommendation: Stop Loss < Entry < Target. "f" Target should be at least 3% ABOVE Entry; Stop Loss should be "f" 1-3% BELOW Entry. If these inequalities do not hold, re-derive "f" the numbers before returning.\n"f" * For a SELL recommendation: Target < Entry < Stop Loss. "f" Target should be at least 3% BELOW Entry; Stop Loss should be "f" 1-3% ABOVE Entry (to cap loss if the short moves against you).\n"f" * For a HOLD recommendation: Entry = current price, and Stop Loss / "f" Target can be left at approximate boundaries of the current range.\n"f" * The Risk Manager provides ATR-based stop-loss suggestions — "f" honor them when they satisfy the BUY/SELL inequality above.\n\n"f"Your output MUST follow this exact format:\n"f"{ticker} — ACTION (Confidence: XX%)\n"f"Entry: $XX.XX\n"f"Stop Loss: $XX.XX\n"f"Target: $XX.XX\n"f"Reasoning:\n"f"- Market: [summary]\n"f"- Fundamental: [summary]\n"f"- Technical: [summary]\n"f"- Risk: [summary]"),expected_output=(f"A trading signal in the format: "90 unmodified lines91929394959697989910010110210310410510610710810911011111290 unmodified linesreturn Task(description=(f"Synthesize all analysis for {ticker} into a final trading signal. "f"Use the current price reported by get_price_change as Entry. "f"For BUY: Stop Loss below Entry, Target above Entry (within 5%). "f"For SELL: Stop Loss above Entry, Target below Entry (within 5%). "f"Keep the response concise — do not deliberate at length.\n\n"f"Output EXACTLY this format on its own lines, with NO extra prose:\n"f"{ticker} — BUY (Confidence: 75%)\n"f"Entry: $289.00\n"f"Stop Loss: $283.00\n"f"Target: $298.00\n"f"Reasoning:\n"f"- Market: [one line]\n"f"- Fundamental: [one line]\n"f"- Technical: [one line]\n"f"- Risk: [one line]\n\n"f"(Substitute the real action, confidence, prices, and reasoning; "f"keep every line on its own line; do not echo these instructions.)"),expected_output=(f"A trading signal in the format: "
crew/tasks.py+15-27