@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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +6 -3
- package/dist/server.js.map +1 -1
- package/dist/services/saxo-auth.d.ts +71 -0
- package/dist/services/saxo-auth.d.ts.map +1 -0
- package/dist/services/saxo-auth.js +201 -0
- package/dist/services/saxo-auth.js.map +1 -0
- package/dist/skills/sync.d.ts +13 -11
- package/dist/skills/sync.d.ts.map +1 -1
- package/dist/skills/sync.js +130 -27
- package/dist/skills/sync.js.map +1 -1
- package/dist/web-server.d.ts.map +1 -1
- package/dist/web-server.js +71 -0
- package/dist/web-server.js.map +1 -1
- package/package.json +1 -1
- package/public/index.html +165 -0
- package/skills/saxo/LEARNING.md +42 -0
- package/skills/saxo/SKILL.md +235 -0
- package/skills/saxo/references/api-reference.md +332 -0
- package/skills/saxo/references/asset-classes.md +249 -0
- package/skills/saxo/references/auth.md +209 -0
- package/skills/saxo/references/order-types.md +260 -0
- package/skills/saxo/scripts/saxo-trade.py +314 -0
- package/skills/trading/SKILL.md +7 -3
- package/skills/trading/references/crypto.md +13 -62
- package/skills/trading/references/forex.md +13 -63
- package/skills/trading/references/metals.md +13 -42
- package/skills/trading/references/risk-management.md +23 -51
- package/skills/trading/references/stocks.md +13 -62
- package/skills/trading/references/strategies.md +20 -85
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# Risk Management Reference
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
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
|
-
##
|
|
28
|
+
## What to Research and Build
|
|
40
29
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
##
|
|
36
|
+
## Your Risk Rules
|
|
50
37
|
|
|
51
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
3
|
+
This file is yours — update it constantly based on real trades, research, and market changes.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Getting Started
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
3
|
+
This file is yours — add new strategies, refine based on performance, remove what doesn't work.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Getting Started
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
33
|
+
*This is starting scaffolding. Build your own strategy library through research and real trading.*
|