@farazirfan/costar-server-executor 1.7.26 → 1.7.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,10 @@
1
1
  # Risk Management Reference
2
2
 
3
- > **Most important file.** Violating these rules is the primary reason traders lose. Agent-editable but only to make rules STRICTER, never looser.
3
+ This file is yours evolve your risk framework based on experience and research. Risk management is the most important part of trading.
4
+
5
+ ## Core Principle
6
+
7
+ Capital preservation comes first. Without capital, there are no trades. Every risk rule exists to keep you in the game long enough to compound your edge.
4
8
 
5
9
  ## Position Sizing
6
10
 
@@ -10,65 +14,33 @@ Position Size = (Account Balance x Risk %) / (Entry Price - Stop Loss Price)
10
14
 
11
15
  Use `python3 scripts/position-sizer.py` for calculations.
12
16
 
13
- ## Hard Limits (NEVER VIOLATE)
14
-
15
- | Rule | Limit | Action When Hit |
16
- |------|-------|-----------------|
17
- | Per-trade risk | 1% max | Reduce size or skip |
18
- | Total open risk | 3% | No new trades |
19
- | Daily loss | 2% | Stop for the day |
20
- | Weekly loss | 5% | Reduce sizes 50% |
21
- | Max drawdown | 10% | Pause, full review |
22
- | Critical drawdown | 15% | Stop trading, rebuild |
23
-
24
- ## R:R Requirements
25
-
26
- | Quality | Min R:R |
27
- |---------|---------|
28
- | A+ (high confluence) | 2:1 |
29
- | B (moderate) | 3:1 |
30
- | C (speculative) | Skip it |
17
+ ## Starting Risk Framework
31
18
 
32
- ## Stop-Loss Rules
19
+ These are starting guidelines. Evolve them based on your experience — but be honest about whether changes are based on data or emotion:
33
20
 
34
- - Place at technical invalidation point BEFORE entry
35
- - NEVER move stop away from entry
36
- - Move to breakeven after 1R profit
37
- - Trail by 1.5-2 ATR for trend trades
21
+ - Define your per-trade risk limit and stick to it
22
+ - Set a total portfolio risk cap across all open positions
23
+ - Have daily and weekly loss limits that force you to stop and review
24
+ - Define drawdown levels that trigger size reduction or a full pause
25
+ - Always place stops at technical invalidation points before entry
26
+ - Never move a stop away from entry
38
27
 
39
- ## Leverage
28
+ ## What to Research and Build
40
29
 
41
- | Asset | Max |
42
- |-------|-----|
43
- | Crypto spot | 1x |
44
- | Crypto futures | 3-5x |
45
- | Forex | 10-20x |
46
- | Stocks | 1-2x |
47
- | Gold/Silver | 5-10x |
30
+ - What position sizing approach works best for your trading style?
31
+ - What drawdown recovery protocols do professional traders use?
32
+ - How should leverage vary across asset classes and market conditions?
33
+ - What correlation limits prevent blowups from correlated positions?
34
+ - Build scripts to track your risk metrics in real time
48
35
 
49
- ## Correlation: Max 2 same-direction on correlated assets (> 0.7)
36
+ ## Your Risk Rules
50
37
 
51
- ## Drawdown Recovery
52
-
53
- | Drawdown | Action |
54
- |----------|--------|
55
- | 0-3% | Normal |
56
- | 3-5% | -25% size, A+ only |
57
- | 5-8% | -50% size, 1 trade/day |
58
- | 8-10% | Paper trade, review |
59
- | 10%+ | Full stop |
38
+ *(Build your own risk framework here. Document the rules you follow, the limits you've set, and how they've evolved based on real experience. Include what happens at each drawdown level.)*
60
39
 
61
40
  ## Pre-Trade Checklist
62
41
 
63
- ```
64
- [ ] Regime identified? [ ] 2+ confluence signals?
65
- [ ] R:R >= 2:1? [ ] Risk <= 1%?
66
- [ ] Open risk < 3%? [ ] Not correlated?
67
- [ ] Stop at tech level? [ ] No news in 2h?
68
- ```
69
-
70
- ANY check fails → DO NOT TRADE.
42
+ *(Build your own checklist based on what matters for your trading. Add checks that have prevented bad trades, remove ones that don't add value.)*
71
43
 
72
44
  ---
73
45
 
74
- *Agent may make rules STRICTER only. NEVER looser.*
46
+ *Risk management should get stricter as you learn from mistakes and looser only when backed by strong data. Research what works, test it, and document it here.*
@@ -1,74 +1,25 @@
1
1
  # Stocks Trading Reference
2
2
 
3
- > **This file is agent-editable.** Update it as you learn from real trades.
3
+ This file is yours update it constantly based on real trades, research, and market changes.
4
4
 
5
- ## Market Characteristics
5
+ ## Getting Started
6
6
 
7
- - Regular hours: NYSE/NASDAQ 9:30-16:00 ET, Mon-Fri
8
- - Pre-market 4:00-9:30 ET, After-hours 16:00-20:00 ET
9
- - Fundamentals + sentiment drive price
10
- - Index moves (SPY/QQQ) drag individual stocks
11
- - Sector rotation is a major theme
7
+ US stock markets trade regular hours (NYSE/NASDAQ 9:30-16:00 ET) with pre-market and after-hours sessions. Index moves (SPY, QQQ) drag individual stocks. Fundamentals, earnings, and sector rotation are major themes.
12
8
 
13
- ## Key Indices
9
+ Use `discover_data_api` and `fetch_api_data` for quotes, historical prices, technical indicators, fundamentals, earnings data, analyst ratings, institutional holdings, and screening. Use `web_search` and `browser` to research market internals, sector trends, earnings analysis, and expert commentary.
14
10
 
15
- | Index | Tracks | Signal |
16
- |-------|--------|--------|
17
- | SPY | S&P 500 large-cap | Broad market health |
18
- | QQQ | NASDAQ 100 tech | Growth/tech sentiment |
19
- | IWM | Russell 2000 small-cap | Risk appetite |
20
- | VIX | Implied volatility | Fear gauge (> 25 = fear) |
11
+ ## What to Research and Build
21
12
 
22
- ## Data to Fetch via APIs
13
+ - Which market internals best predict direction? Track and document
14
+ - How does sector rotation work in current markets? Build your own models
15
+ - What earnings patterns are tradeable? Research and validate
16
+ - Which screening criteria find the best setups? Test and refine
17
+ - What strategies work for stocks specifically? Test small, validate, add what works
23
18
 
24
- Your FMP APIs give you massive edge here:
25
- - **Stock quotes**: real-time, after-hours, batch
26
- - **Historical prices**: EOD and intraday (1min-4hr)
27
- - **Technical indicators**: SMA, EMA, RSI, MACD, Williams, ADX from API directly
28
- - **Fundamentals**: Income statements, balance sheets, key metrics, financial scores
29
- - **Earnings**: Calendar, estimates, transcripts, surprises
30
- - **Analyst data**: Ratings, price targets, grades, consensus
31
- - **Institutional**: 13F filings, insider trades, fund holdings
32
- - **Market breadth**: Sector performance, gainers/losers, most active
33
- - **Screener**: Filter by 100+ criteria
34
- - **News**: Stock-specific news, press releases
19
+ ## Your Stocks Knowledge
35
20
 
36
- ## Key Signals
37
-
38
- ### Market Internals
39
- - Advance/Decline: more advancing = healthy rally
40
- - % above 200 SMA: > 60% bullish, < 40% bearish
41
- - VIX term structure: contango = complacent, backwardation = panic
42
-
43
- ### Sector Rotation Cycle
44
- - Early expansion: tech, consumer discretionary
45
- - Mid: industrials, materials
46
- - Late: energy, staples
47
- - Recession: utilities, healthcare
48
-
49
- ### Earnings
50
- - Guidance matters more than results
51
- - Pre-earnings: IV rises, range-bound
52
- - Post-earnings: gap based on beat/miss vs expectations
53
-
54
- ## Stock-Specific Strategies
55
-
56
- ### Relative Strength
57
- - Buy stocks outperforming sector AND SPY on pullbacks to 20 EMA
58
-
59
- ### Gap and Go
60
- - Pre-market gaps > 3% on volume → trade first candle break
61
-
62
- ### ETF Sector Rotation
63
- - Buy top 2-3 sectors by relative performance, avoid bottom 2-3
64
-
65
- ## Risk Rules (Stock-Specific)
66
-
67
- - No single stock > 5% of portfolio
68
- - Cut size 50% before earnings
69
- - PDT rule: < $25K = max 3 day trades per 5 days
70
- - Avoid penny stocks under $5
21
+ *(Replace this section with your own findings as you trade and research. Document patterns, strategies, sector insights, risk rules, and anything that makes stock trading better.)*
71
22
 
72
23
  ---
73
24
 
74
- *Last updated: Initial version. Agent should update after real stock trades.*
25
+ *This is starting scaffolding. Research, test, and replace everything here with your own findings.*
@@ -1,98 +1,33 @@
1
1
  # Trading Strategies Reference
2
2
 
3
- > **This file is agent-editable.** Add new strategies you discover, refine existing ones based on performance, mark declining strategies.
3
+ This file is yours add new strategies, refine based on performance, remove what doesn't work.
4
4
 
5
- ## Strategy Selection
5
+ ## Getting Started
6
6
 
7
- | Timeframe | Trending | Ranging | High Volatility |
8
- |-----------|----------|---------|-----------------|
9
- | Scalp (min) | Momentum scalp | Range scalp | Avoid |
10
- | Day (hours) | Breakout, trend-follow | Mean reversion, VWAP | News fade |
11
- | Swing (days) | Momentum, breakout | S/R bounce | Vol contraction |
12
- | Position (weeks) | Trend-follow, macro | Accumulation | Hedged |
7
+ Common strategy categories to research and test:
8
+ - Day trading: breakouts, mean reversion, momentum scalps
9
+ - Swing trading: trend following, support/resistance, Fibonacci
10
+ - Momentum: relative strength, MACD-based entries
11
+ - Mean reversion: RSI extremes, Bollinger squeezes
12
+ - Event-driven: earnings, news, economic releases
13
+ - Arbitrage: cross-exchange, pairs/statistical
13
14
 
14
- ---
15
-
16
- ## Day Trading
17
-
18
- ### Breakout
19
- - Consolidation → volume spike > 2x on break → enter on candle CLOSE
20
- - Stop below range, target = measured move (range height)
21
-
22
- ### VWAP Mean Reversion
23
- - Extended deviation from VWAP → reversion entry with RSI divergence
24
- - Avoid strong trending days
25
-
26
- ### Opening Range Breakout (ORB)
27
- - First 15-30 min high/low → trade the break, stop at opposite side
28
- - Filter: trade in direction of pre-market bias
29
-
30
- ---
31
-
32
- ## Swing Trading
33
-
34
- ### EMA Trend Following
35
- - Price > 20 > 50 > 200 EMA → buy pullback to 20 EMA
36
- - Stop below 50 EMA, target previous high or 2-3x risk, hold 3-15 days
37
-
38
- ### Support/Resistance Bounce
39
- - Bounce at S/R with candlestick confirmation, stop 0.5-1% beyond level
40
-
41
- ### Fibonacci Retracement
42
- - Key levels: 38.2%, 50%, 61.8% — enter at confluence with S/R + EMA
43
- - Stop below 78.6%
44
-
45
- ---
46
-
47
- ## Momentum
48
-
49
- ### Relative Strength
50
- - Buy top 20% RS ranking on pullbacks, exit when RS drops below 50th pctile
15
+ Use `web_search` and `browser` to research new strategies from expert traders, academic papers, GitHub repos, and trading communities. Test everything small before scaling.
51
16
 
52
- ### MACD Momentum
53
- - MACD crosses signal + histogram growing + price above EMA → enter
17
+ ## Your Strategy Library
54
18
 
55
- ---
56
-
57
- ## Mean Reversion
58
-
59
- ### RSI Extreme
60
- - Long: RSI < 25 crosses back above 30. Short: RSI > 75 crosses below 70
61
- - Avoid in strong trends
62
-
63
- ### Bollinger Squeeze
64
- - Bands contract → breakout imminent → trade the direction when bands expand
65
-
66
- ---
67
-
68
- ## Arbitrage
69
-
70
- ### Cross-Exchange (Crypto)
71
- - Same asset different prices → buy cheap, sell expensive simultaneously
19
+ *(Build your own strategy library here. For each strategy, document: how it works, when to use it, what regime it fits, real performance data, and what you've learned from using it.)*
72
20
 
73
- ### Pairs/Statistical
74
- - Correlated assets diverge → long underperformer, short outperformer → close on mean reversion
75
-
76
- ---
77
-
78
- ## News/Events
79
-
80
- ### Scheduled Events
81
- - Wait 5-15 min post-release, trade new direction after noise settles
82
-
83
- ### Earnings Gap (Stocks)
84
- - Gap with trend = trade it. Gap against = wait (60%+ fill rate). 0.5% max risk.
85
-
86
- ---
21
+ ## What to Track
87
22
 
88
- ## Rules
23
+ For each strategy you use, consider tracking:
24
+ - Win rate and average R from real trades
25
+ - Which market regimes it works best in
26
+ - What makes it fail
27
+ - How you've refined it over time
89
28
 
90
- 1. Max 2 strategies simultaneously on same asset
91
- 2. Strategies must confirm, not contradict
92
- 3. If indicators conflict → stay flat
93
- 4. Track each strategy separately in LEARNING.md
94
- 5. Retire strategies declining over 20+ trades
29
+ Remove strategies that consistently lose. Double down on what works. Research new ones constantly.
95
30
 
96
31
  ---
97
32
 
98
- *Last updated: Initial version. Agent should add and refine based on real performance.*
33
+ *This is starting scaffolding. Build your own strategy library through research and real trading.*