Commit ·
1d4dd5c
1
Parent(s): 8e7369a
Tighten Strategist prompt with explicit BUY/SELL/HOLD price inequalities
Browse filesQwen3-14B grounds the entry price in the real tool output but
previously produced a stop_loss ABOVE entry on a BUY (stop 298,
entry 288, target 289) because the original prompt only showed the
format, not the semantics of each field. The tightened prompt
spells out: BUY -> Stop < Entry < Target; SELL -> Target < Entry <
Stop; and ties Entry to the Market Scanner's get_price_change
output.
- crew/tasks.py +15 -0
crew/tasks.py
CHANGED
|
@@ -94,6 +94,21 @@ def create_strategy_task(agent: Agent, ticker: str, context: list) -> Task:
|
|
| 94 |
f"Consider the market conditions, fundamental valuation, technical signals, "
|
| 95 |
f"and risk parameters. Produce a clear BUY, SELL, or HOLD recommendation "
|
| 96 |
f"with a confidence percentage.\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
f"Your output MUST follow this exact format:\n"
|
| 98 |
f"{ticker} — ACTION (Confidence: XX%)\n"
|
| 99 |
f"Entry: $XX.XX\n"
|
|
|
|
| 94 |
f"Consider the market conditions, fundamental valuation, technical signals, "
|
| 95 |
f"and risk parameters. Produce a clear BUY, SELL, or HOLD recommendation "
|
| 96 |
f"with a confidence percentage.\n\n"
|
| 97 |
+
f"CRITICAL PRICE RULES — check each value before you output it:\n"
|
| 98 |
+
f" * Use the CURRENT PRICE reported by the Market Scanner's "
|
| 99 |
+
f" get_price_change tool as the basis for Entry. Do NOT invent a "
|
| 100 |
+
f" price from memory.\n"
|
| 101 |
+
f" * For a BUY recommendation: Stop Loss < Entry < Target. "
|
| 102 |
+
f" Target should be at least 3% ABOVE Entry; Stop Loss should be "
|
| 103 |
+
f" 1-3% BELOW Entry. If these inequalities do not hold, re-derive "
|
| 104 |
+
f" the numbers before returning.\n"
|
| 105 |
+
f" * For a SELL recommendation: Target < Entry < Stop Loss. "
|
| 106 |
+
f" Target should be at least 3% BELOW Entry; Stop Loss should be "
|
| 107 |
+
f" 1-3% ABOVE Entry (to cap loss if the short moves against you).\n"
|
| 108 |
+
f" * For a HOLD recommendation: Entry = current price, and Stop Loss / "
|
| 109 |
+
f" Target can be left at approximate boundaries of the current range.\n"
|
| 110 |
+
f" * The Risk Manager provides ATR-based stop-loss suggestions — "
|
| 111 |
+
f" honor them when they satisfy the BUY/SELL inequality above.\n\n"
|
| 112 |
f"Your output MUST follow this exact format:\n"
|
| 113 |
f"{ticker} — ACTION (Confidence: XX%)\n"
|
| 114 |
f"Entry: $XX.XX\n"
|