Skip to content

Commit f7d0192

Browse files
committed
Add top 5 US stocks (AAPL, MSFT, GOOGL, AMZN, NVDA)
Added the 5 largest US stocks by market cap: - AAPL (Apple) - $3.0T market cap, price ~$230 - MSFT (Microsoft) - $2.8T market cap, price ~$420 - GOOGL (Alphabet/Google) - $1.7T market cap, price ~$175 - AMZN (Amazon) - $1.5T market cap, price ~$185 - NVDA (Nvidia) - $1.5T market cap, price ~$140 Benefits: - Stocks optimal hours: 15:30-19:30 UTC (NOW!) - More diversification (forex + gold + stocks) - Higher volatility (NVDA ~$4/hour movement) - Can trade stocks RIGHT NOW at 18:35 UTC Total symbols now: 9 instruments - 3 Forex pairs (13:00-17:00 UTC) - 1 Gold (13:00-20:00 UTC) - 5 US Stocks (15:30-19:30 UTC) Mock data updated with realistic 2024 prices and volatility.
1 parent 3a53ed5 commit f7d0192

File tree

2 files changed

+59
-9
lines changed

2 files changed

+59
-9
lines changed

src/agents/mt5_trading_agent.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,19 @@ def __init__(
8484
max_position_size: Maximum position size in lots
8585
max_positions: Maximum number of concurrent positions
8686
"""
87-
self.symbols = symbols or ['EURUSD', 'GBPUSD', 'USDJPY', 'XAUUSD'] # Added XAUUSD (Gold)
87+
# Default symbols: 3 forex pairs + 1 gold + 5 top US stocks
88+
self.symbols = symbols or [
89+
# Forex pairs (optimal hours: 13:00-17:00 UTC)
90+
'EURUSD', 'GBPUSD', 'USDJPY',
91+
# Gold (optimal hours: 13:00-20:00 UTC)
92+
'XAUUSD',
93+
# Top 5 US stocks by market cap (optimal hours: 15:30-19:30 UTC)
94+
'AAPL', # Apple - $3.0T market cap
95+
'MSFT', # Microsoft - $2.8T market cap
96+
'GOOGL', # Alphabet/Google - $1.7T market cap
97+
'AMZN', # Amazon - $1.5T market cap
98+
'NVDA', # Nvidia - $1.5T market cap
99+
]
88100
self.model_type = model_type
89101
self.model_name = model_name or MT5_MODEL_NAME # Use MT5-specific model name from config
90102
self.max_position_size = max_position_size

src/nice_funcs_mt5.py

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,38 @@ def get_mock_account_info() -> Dict:
6565

6666
def get_mock_symbol_info(symbol: str) -> Dict:
6767
"""Generate mock symbol info for sandbox/testing"""
68-
# Different spreads for different asset classes
69-
if 'XAU' in symbol or 'GOLD' in symbol:
70-
spread = 30 # Gold
68+
# Different spreads and parameters for different asset classes
69+
70+
# Stocks (AAPL, MSFT, etc.)
71+
if symbol in ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'NVDA', 'TSLA', 'META', 'NFLX']:
72+
spread = 2 # Stocks typically 2-5 cents spread
73+
point = 0.01 # $0.01 per point
74+
contract_size = 100 # 100 shares per lot
75+
76+
# Gold
77+
elif 'XAU' in symbol or 'GOLD' in symbol:
78+
spread = 30 # Gold 30-50 pips spread
7179
point = 0.01
80+
contract_size = 100
81+
82+
# Forex
7283
elif any(x in symbol for x in ['EUR', 'GBP', 'USD', 'JPY']):
73-
spread = 10 # Forex
84+
spread = 10 # Forex 1-2 pips spread
7485
point = 0.00001
86+
contract_size = 100000
87+
88+
# Other
7589
else:
76-
spread = 20 # Other
90+
spread = 20
7791
point = 0.01
92+
contract_size = 100
7893

7994
return {
8095
'symbol': symbol,
8196
'point': point,
8297
'digits': 5 if point == 0.00001 else 2,
8398
'spread': spread,
84-
'trade_contract_size': 100000 if point == 0.00001 else 100,
99+
'trade_contract_size': contract_size,
85100
'volume_min': 0.01,
86101
'volume_max': 100.0,
87102
'volume_step': 0.01,
@@ -91,8 +106,27 @@ def get_mock_ohlcv(symbol: str, timeframe: str = '1H', bars: int = 100) -> pd.Da
91106
"""Generate realistic mock OHLCV data for sandbox/testing"""
92107
import random
93108

94-
# Base prices for different instruments
95-
if 'EUR' in symbol and 'USD' in symbol:
109+
# Base prices for different instruments (realistic 2024 prices)
110+
111+
# US Stocks
112+
if symbol == 'AAPL':
113+
base_price = 230.00 # Apple ~$230
114+
volatility = 2.0
115+
elif symbol == 'MSFT':
116+
base_price = 420.00 # Microsoft ~$420
117+
volatility = 3.5
118+
elif symbol == 'GOOGL':
119+
base_price = 175.00 # Google ~$175
120+
volatility = 2.5
121+
elif symbol == 'AMZN':
122+
base_price = 185.00 # Amazon ~$185
123+
volatility = 3.0
124+
elif symbol == 'NVDA':
125+
base_price = 140.00 # Nvidia ~$140
126+
volatility = 4.0 # NVDA has high volatility
127+
128+
# Forex
129+
elif 'EUR' in symbol and 'USD' in symbol:
96130
base_price = 1.0850
97131
volatility = 0.0005
98132
elif 'GBP' in symbol and 'USD' in symbol:
@@ -101,9 +135,13 @@ def get_mock_ohlcv(symbol: str, timeframe: str = '1H', bars: int = 100) -> pd.Da
101135
elif 'USD' in symbol and 'JPY' in symbol:
102136
base_price = 149.50
103137
volatility = 0.15
138+
139+
# Gold
104140
elif 'XAU' in symbol or 'GOLD' in symbol:
105141
base_price = 2650.00
106142
volatility = 5.0
143+
144+
# Default
107145
else:
108146
base_price = 100.0
109147
volatility = 0.5

0 commit comments

Comments
 (0)