pip3 install ib_insync
python3 test_ibkr.py
brew install python@3.11
brew install python@3.11
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install python@3.11
brew install python@3.11
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> /Users/rafalsoltysek/.zprofile\
echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> /Users/rafalsoltysek/.zprofile\
eval "$(/opt/homebrew/bin/brew shellenv zsh)"
echo >> /Users/rafalsoltysek/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> /Users/rafalsoltysek/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv zsh)"
brew install python@3.11
/opt/homebrew/bin/python3.11 -m pip install ib_insync
/opt/homebrew/bin/python3.11 test_ibkr.py
/opt/homebrew/bin/python3.11 test_ibkr.py
/opt/homebrew/bin/python3.11 -m pip install anthropic
/opt/homebrew/bin/python3.11 -m pip install ib_async
export ANTHROPIC_API_KEY=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
echo $ANTHROPIC_API_KEY
/opt/homebrew/bin/python3.11 -m pip install anthropic
/opt/homebrew/bin/python3.11 claude_trader.py
/opt/homebrew/bin/python3.11 claude_trader.py
export ANTHROPIC_API_KEY="your-key-here"\
/opt/homebrew/bin/python3.11 claude_trader.py
echo 'export ANTHROPIC_API_KEY=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 >> ~/.zprofile && source ~/.zprofile\
/opt/homebrew/bin/python3.11 claude_trader.py\
echo 'export ANTHROPIC_API_KEY="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"' >> ~/.zprofile\
source ~/.zprofile\
/opt/homebrew/bin/python3.11 claude_trader.py\
echo 'export ANTHROPIC_API_KEY="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"' >> ~/.zprofile\
source ~/.zprofile\
/opt/homebrew/bin/python3.11 claude_trader.py\
echo 'export ANTHROPIC_API_KEY="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"' >> ~/.zprofile\
export ANTHROPIC_API_KEY="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"' >> ~/.zprofile\
quote> \

export ANTHROPIC_API_KEY="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"' >> ~/.zprofile\
\
export ANTHROPIC_API_KEY=sk-ant-api03-sSAtUg7zYOURFULLKEY\
/opt/homebrew/bin/python3.11 claude_trader.py\
export ANTHROPIC_API_KEY="sk-ant-api03-sSAtUg7z..."\
source ~/.zprofile\
/opt/homebrew/bin/python3.11 claude_trader.py
source ~/.zprofile\
/opt/homebrew/bin/python3.11 claude_trader.py
/opt/homebrew/bin/python3.11 claude_trader.py
/opt/homebrew/bin/python3.11 claude_trader.py
/opt/homebrew/bin/python3.11 -m pip install python-dotenv
/opt/homebrew/bin/python3.11 bot.py --symbol NVDA --check-only
/opt/homebrew/bin/python3.11 bot.py --symbol NVDA --check-only
/opt/homebrew/bin/python3.11 bot.py --symbol NVDA
/opt/homebrew/bin/python3.11 bot.py --symbol NVDA --check-only
/opt/homebrew/bin/python3.11 closer.py
/opt/homebrew/bin/python3.11 bot.py --symbol AMD --check-only
/opt/homebrew/bin/python3.11 bot.py --symbol AMD --claude-only
/opt/homebrew/bin/python3.11 bot.py --symbol AMD --claude-only
/opt/homebrew/bin/python3.11 bot.py --symbol AMD --claude-only
/opt/homebrew/bin/python3.11 bot.py --symbol AMD --claude-only
echo -e "NVDA\nAMD\nMU\nTSLA\nMETA" > ~/watchlist.txt
/opt/homebrew/bin/python3.11 scanner.py
/opt/homebrew/bin/python3.11 monitor.py
/opt/homebrew/bin/python3.11 morning_prefilter.py --dry-run
/opt/homebrew/bin/python3.11 morning_prefilter.py --dry-run
rm -rf ~/Library/Caches/py-yfinance /tmp/yf_tz_cache && /opt/homebrew/bin/python3.11 morning_prefilter.py --dry-run
/opt/homebrew/bin/python3.11 morning_prefilter.py
rm -rf ~/Library/Caches/py-yfinance && /opt/homebrew/bin/python3.11 morning_prefilter.py --dry-run
rm -rf ~/Library/Caches/py-yfinance && /opt/homebrew/bin/python3.11 morning_prefilter.py --dry-run
rm -rf ~/Library/Caches/py-yfinance && /opt/homebrew/bin/python3.11 morning_prefilter.py --dry-run
/opt/homebrew/bin/python3.11 morning_prefilter.py
/opt/homebrew/bin/python3.11 morning_prefilter.py
/opt/homebrew/bin/python3.11 scanner.py
source ~/.zprofile && /opt/homebrew/bin/python3.11 bot.py --symbol IBM
source ~/.zprofile && /opt/homebrew/bin/python3.11 cycle.py
source ~/.zprofile && /opt/homebrew/bin/python3.11 -c "from src.notify import notify; notify('Test', 'Hello from IBKR bot')"
echo "NOTIFY_URL=https://ntfy.sh/ibkr-bot-alerts" >> .env
source ~/.zprofile && /opt/homebrew/bin/python3.11 -c "from src.notify import notify; notify('Test', 'Hello')"
source ~/.zprofile && /opt/homebrew/bin/python3.11 -c "from src.notify import notify; notify('Hello', 'Test from IBKR bot')"
source ~/.zprofile && /opt/homebrew/bin/python3.11 cycle.py
source ~/.zprofile && /opt/homebrew/bin/python3.11 -c "\
from src.ibkr_client import IBKRClient\
import os\
\
try:\
    ibkr = IBKRClient('127.0.0.1', 7497, 2)\
    print('Connected âƒ¼ƒ³')\
    \
    accounts = ibkr.ib.managedAccounts()\
    print(f'Accounts: {accounts}')\
    \
    # Try to get account summary\
    from ib_async import AccountSummaryTag\
    ibkr.ib.reqAccountSummary(9999, 'All', 'NetLiquidation,TotalCashValue,EquityWithLoanValue')\
    import time\
    time.sleep(2)\
    summary = ibkr.ib.accountSummary()\
    print(f'Account Summary: {summary}')\
    \
    ibkr.disconnect()\
except Exception as e:\
    print(f'Error: {e}')\
    import traceback\
    traceback.print_exc()\
"
$ curl -d "Hi" https://ntfy.sh/ibkr-bot-alerts\
\

curl "https://api.telegram.org/bot{YOUR_TOKEN}/getUpdates" | python3 -m json.tool
curl "https://api.telegram.org/bot8906610262:AAEInp8B9fxBEE9AEVaePkaZ6yN_zYvas8c/getUpdates" | python3 -m json.tool
curl "https://api.telegram.org/bot8906610262:AAEInp8B9fxBEE9AEVaePkaZ6yN_zYvas8c/getUpdates" | python3 -m json.tool
echo "TELEGRAM_BOT_TOKEN=8906610262:AAEInp8B9fxBEE9AEVaePkaZ6yN_zYvas8c" >> ~/.env\
echo "TELEGRAM_CHAT_ID=871947607" >> ~/.env
source ~/.zprofile && /opt/homebrew/bin/python3.11 -c "from src.notify import notify; notify('Test', 'Telegram is working')"
source ~/.zprofile && /opt/homebrew/bin/python3.11 morning_prefilter.py
source ~/.zprofile && /opt/homebrew/bin/python3.11 scanner.py
echo "MAX_TRADES_PER_DAY=10" >> ~/.env
source ~/.zprofile && /opt/homebrew/bin/python3.11 scanner.py
*/5 10-16 * * 1-5 source ~/.zprofile && /opt/homebrew/bin/python3.11 /Users/rafalsoltysek/cycle.py
/opt/homebrew/bin/python3.11 << 'EOF'\
import os\
from dotenv import load_dotenv\
load_dotenv()\
\
token = os.getenv("TELEGRAM_BOT_TOKEN", "")\
chat_id = os.getenv("TELEGRAM_CHAT_ID", "")\
\
print(f"Token loaded: {bool(token)}")\
print(f"Chat ID loaded: {bool(chat_id)}")\
\
if token and chat_id:\
    import requests\
    url = f"https://api.telegram.org/bot{token}/sendMessage"\
    data = {\
        "chat_id": chat_id,\
        "text": "*Test*\nHello from IBKR bot",\
        "parse_mode": "Markdown"\
    }\
    try:\
        r = requests.post(url, json=data, timeout=5)\
        print(f"Status: {r.status_code}")\
        print(f"Response: {r.text}")\
    except Exception as e:\
        print(f"Error: {e}")\
else:\
    print("Token or Chat ID missing!")\
EOF
source ~/.zprofile && /opt/homebrew/bin/python3.11 << 'EOF'\
import os\
\
token = os.getenv("TELEGRAM_BOT_TOKEN", "")\
chat_id = os.getenv("TELEGRAM_CHAT_ID", "")\
\
print(f"Token loaded: {bool(token)}")\
print(f"Chat ID loaded: {bool(chat_id)}")\
\
if token and chat_id:\
    import requests\
    url = f"https://api.telegram.org/bot{token}/sendMessage"\
    data = {\
        "chat_id": chat_id,\
        "text": "*Test*\nHello from IBKR bot",\
        "parse_mode": "Markdown"\
    }\
    try:\
        r = requests.post(url, json=data, timeout=5)\
        print(f"Status: {r.status_code}")\
        print(f"Response: {r.text}")\
    except Exception as e:\
        print(f"Error: {e}")\
else:\
    print("Token or Chat ID missing!")\
EOF
cat ~/.env | grep TELEGRAM
cat >> ~/.env << 'EOF'\
TELEGRAM_BOT_TOKEN=8906610262:AAEInp8B9fxBEE9AEVaePkaZ6yN_zYvas8c\
TELEGRAM_CHAT_ID=871947607\
EOF
source ~/.zprofile && /opt/homebrew/bin/python3.11 -c "import os; from dotenv import load_dotenv; load_dotenv(); print('Token:', bool(os.getenv('TELEGRAM_BOT_TOKEN'))); print('Chat ID:', bool(os.getenv('TELEGRAM_CHAT_ID')))"
source ~/.zprofile && /opt/homebrew/bin/python3.11 << 'EOF'\
import os\
from dotenv import load_dotenv\
load_dotenv()\
\
import requests\
\
token = os.getenv("TELEGRAM_BOT_TOKEN")\
chat_id = os.getenv("TELEGRAM_CHAT_ID")\
\
url = f"https://api.telegram.org/bot{token}/sendMessage"\
data = {\
    "chat_id": chat_id,\
    "text": "*Test*\nHello from IBKR bot",\
    "parse_mode": "Markdown"\
}\
\
r = requests.post(url, json=data, timeout=5)\
print(f"Status: {r.status_code}")\
print(f"Response: {r.text}")\
EOF
cat > /tmp/test_telegram.py << 'EOF'\
import os\
import requests\
\
token = os.getenv("TELEGRAM_BOT_TOKEN")\
chat_id = os.getenv("TELEGRAM_CHAT_ID")\
\
url = f"https://api.telegram.org/bot{token}/sendMessage"\
data = {\
    "chat_id": chat_id,\
    "text": "*Test*\nHello from IBKR bot",\
    "parse_mode": "Markdown"\
}\
\
r = requests.post(url, json=data, timeout=5)\
print(f"Status: {r.status_code}")\
print(f"Response: {r.text}")\
EOF\
\
source ~/.zprofile && /opt/homebrew/bin/python3.11 /tmp/test_telegram.py
cat > /tmp/test_token.py << 'EOF'\
import os\
import requests\
\
token = os.getenv("TELEGRAM_BOT_TOKEN")\
chat_id = os.getenv("TELEGRAM_CHAT_ID")\
\
print(f"Token: {token[:20]}..." if token else "Token: NOT SET")\
print(f"Chat ID: {chat_id}")\
\
# Test if token is valid\
url = f"https://api.telegram.org/bot{token}/getMe"\
r = requests.get(url, timeout=5)\
print(f"\nToken test Status: {r.status_code}")\
print(f"Response: {r.text}")\
EOF\
\
source ~/.zprofile && /opt/homebrew/bin/python3.11 /tmp/test_token.py
cat >> ~/.zprofile << 'EOF'\
export TELEGRAM_BOT_TOKEN="8906610262:AAEInp8B9fxBEE9AEVaePkaZ6yN_zYvas8c"\
export TELEGRAM_CHAT_ID="871947607"\
EOF
cat >> ~/.zprofile << 'EOF'\
export TELEGRAM_BOT_TOKEN="8906610262:AAEInp8B9fxBEE9AEVaePkaZ6yN_zYvas8c"\
export TELEGRAM_CHAT_ID="871947607"\
EOF
source ~/.zprofile && /opt/homebrew/bin/python3.11 /tmp/test_token.py
source ~/.zprofile && /opt/homebrew/bin/python3.11 << 'EOF'\
import os\
import requests\
\
token = os.getenv("TELEGRAM_BOT_TOKEN")\
chat_id = os.getenv("TELEGRAM_CHAT_ID")\
\
url = f"https://api.telegram.org/bot{token}/sendMessage"\
data = {\
    "chat_id": chat_id,\
    "text": "*Test Message*\nHello from IBKR bot",\
    "parse_mode": "Markdown"\
}\
\
r = requests.post(url, json=data, timeout=5)\
print(f"Status: {r.status_code}")\
print(f"Response: {r.text}")\
EOF
source ~/.zprofile && /opt/homebrew/bin/python3.11 scanner.py
source ~/.zprofile && /opt/homebrew/bin/python3.11 << 'EOF'\
import os\
import requests\
import time\
\
token = os.getenv("TELEGRAM_BOT_TOKEN")\
chat_id = os.getenv("TELEGRAM_CHAT_ID")\
\
url = f"https://api.telegram.org/bot{token}/sendMessage"\
data = {\
    "chat_id": chat_id,\
    "text": "ðƒ¿¤ƒ¶ IBKR Bot Test - Check if you see this",\
    "parse_mode": "HTML"\
}\
\
r = requests.post(url, json=data, timeout=5)\
print(f"Sent - Status: {r.status_code}")\
time.sleep(1)\
print("Check Telegram now")\
EOF
crontab -e
(crontab -l 2>/dev/null; cat << 'EOF'\
# Morning prefilter at 8:30 AM ET (5:30 AM PST)\
30 8 * * 1-5 source ~/.zprofile && /opt/homebrew/bin/python3.11 /Users/rafalsoltysek/morning_prefilter.py >> /Users/rafalsoltysek/logs/prefilter_cron.log 2>&1\
\
# Cycle every 5 min from 8:30 AM - 4:00 PM ET (5:30 AM - 1:00 PM PST), Mon-Fri\
*/5 8-16 * * 1-5 source ~/.zprofile && /opt/homebrew/bin/python3.11 /Users/rafalsoltysek/cycle.py >> /Users/rafalsoltysek/logs/cycle_cron.log 2>&1\
EOF\
) | crontab -
crontab -l
 source ~/.zprofile && /opt/homebrew/bin/python3.11 << 'EOF'\
import os\
import requests\
\
token = os.getenv("TELEGRAM_BOT_TOKEN")\
chat_id = os.getenv("TELEGRAM_CHAT_ID")\
\
url = f"https://api.telegram.org/bot{token}/sendMessage"\
data = {\
    "chat_id": chat_id,\
    "text": "âƒ¼ƒ¥ IBKR Bot Ready for Trading",\
    "parse_mode": "HTML"\
}\
\
r = requests.post(url, json=data, timeout=5)\
print(f"Status: {r.status_code}")\
EOF
source ~/.zprofile && /opt/homebrew/bin/python3.11 compute_perf.py
 source ~/.zprofile && /opt/homebrew/bin/python3.11 rotate_logs.py
# Compute daily performance at 4:15 PM ET\
15 16 * * 1-5 source ~/.zprofile && /opt/homebrew/bin/python3.11 /Users/rafalsoltysek/compute_perf.py >> /Users/rafalsoltysek/logs/perf_cron.log 2>&1\
\
# Rotate logs daily at 5:00 PM ET\
0 17 * * 1-5 source ~/.zprofile && /opt/homebrew/bin/python3.11 /Users/rafalsoltysek/rotate_logs.py >> /Users/rafalsoltysek/logs/rotation_cron.log 2>&1
 (crontab -l 2>/dev/null; cat << 'EOF'\
# Compute daily performance at 4:15 PM ET\
15 16 * * 1-5 source ~/.zprofile && /opt/homebrew/bin/python3.11 /Users/rafalsoltysek/compute_perf.py >> /Users/rafalsoltysek/logs/perf_cron.log 2>&1\
\
# Rotate logs daily at 5:00 PM ET\
0 17 * * 1-5 source ~/.zprofile && /opt/homebrew/bin/python3.11 /Users/rafalsoltysek/rotate_logs.py >> /Users/rafalsoltysek/logs/rotation_cron.log 2>&1\
EOF\
) | crontab -
crontab -l
crontab -l
# Rotate logs daily at 5:00 PM ET\
0 17 * * 1-5 source ~/.zprofile && /opt/homebrew/bin/python3.11 /Users/rafalsoltysek/rotate_logs.py >> /Users/rafalsoltysek/logs/rotation_cron.log 2>&1\
rafalsoltysek@iMac ~ % \
source ~/.zprofile && /opt/homebrew/bin/python3.11 compute_perf.py
caffeinate -i -t 28800
source ~/.zprofile && /opt/homebrew/bin/python3.11 compute_perf.py
source ~/.zprofile && /opt/homebrew/bin/python3.11 closer.py
Dashboard saved to dashboard/index.html\
rafalsoltysek@iMac ~ % source ~/.zprofile && /opt/homebrew/bin/python3.11 closer.py\
[16:01:24 ET] Closing 39 shares of GEHC...\
Error 10349, reqId 32: Order TIF was set to DAY based on order preset.\
Canceled order: Trade(contract=Stock(conId=601776309, symbol='GEHC', exchange='SMART', primaryExchange='NASDAQ', currency='USD', localSymbol='GEHC', tradingClass='NMS'), order=MarketOrder(orderId=32, clientId=3, action='SELL', totalQuantity=39, outsideRth=True), orderStatus=OrderStatus(orderId=32, status='Cancelled', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 24, 419486, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 24, 569044, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 32: Order TIF was set to DAY based on order preset.', errorCode=10349)], advancedError='')\
IBKR API validation warning: Trade(contract=Stock(conId=601776309, symbol='GEHC', exchange='SMART', primaryExchange='NASDAQ', currency='USD', localSymbol='GEHC', tradingClass='NMS'), order=MarketOrder(orderId=32, clientId=3, action='SELL', totalQuantity=39, outsideRth=True), orderStatus=OrderStatus(orderId=32, status='ValidationError', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 24, 419486, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 24, 569044, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 32: Order TIF was set to DAY based on order preset.', errorCode=10349), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 24, 574662, tzinfo=datetime.timezone.utc), status='ValidationError', message="Warning 2109, reqId 32: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.", errorCode=2109)], advancedError='')\
Error 201, reqId 32: Order rejected - reason:Exchange is closed.\
[16:01:24 ET] GEHC SELL 39 fill=0 status=Inactive\
[16:01:24 ET] Closing 12 shares of NVDA...\
Error 10349, reqId 34: Order TIF was set to DAY based on order preset.\
Canceled order: Trade(contract=Stock(conId=4815747, symbol='NVDA', exchange='SMART', primaryExchange='NASDAQ', currency='USD', localSymbol='NVDA', tradingClass='NMS'), order=MarketOrder(orderId=34, clientId=3, action='SELL', totalQuantity=12, outsideRth=True), orderStatus=OrderStatus(orderId=34, status='Cancelled', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 26014, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 127986, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 34: Order TIF was set to DAY based on order preset.', errorCode=10349)], advancedError='')\
IBKR API validation warning: Trade(contract=Stock(conId=4815747, symbol='NVDA', exchange='SMART', primaryExchange='NASDAQ', currency='USD', localSymbol='NVDA', tradingClass='NMS'), order=MarketOrder(orderId=34, clientId=3, action='SELL', totalQuantity=12, outsideRth=True), orderStatus=OrderStatus(orderId=34, status='ValidationError', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 26014, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 127986, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 34: Order TIF was set to DAY based on order preset.', errorCode=10349), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 129426, tzinfo=datetime.timezone.utc), status='ValidationError', message="Warning 2109, reqId 34: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.", errorCode=2109)], advancedError='')\
Error 201, reqId 34: Order rejected - reason:Exchange is closed.\
[16:01:25 ET] NVDA SELL 12 fill=0 status=Inactive\
[16:01:25 ET] Closing 119 shares of BBWI...\
Error 10349, reqId 36: Order TIF was set to DAY based on order preset.\
Canceled order: Trade(contract=Stock(conId=502252263, symbol='BBWI', exchange='SMART', primaryExchange='NYSE', currency='USD', localSymbol='BBWI', tradingClass='BBWI'), order=MarketOrder(orderId=36, clientId=3, action='SELL', totalQuantity=119, outsideRth=True), orderStatus=OrderStatus(orderId=36, status='Cancelled', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 625773, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 722069, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 36: Order TIF was set to DAY based on order preset.', errorCode=10349)], advancedError='')\
IBKR API validation warning: Trade(contract=Stock(conId=502252263, symbol='BBWI', exchange='SMART', primaryExchange='NYSE', currency='USD', localSymbol='BBWI', tradingClass='BBWI'), order=MarketOrder(orderId=36, clientId=3, action='SELL', totalQuantity=119, outsideRth=True), orderStatus=OrderStatus(orderId=36, status='ValidationError', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 625773, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 722069, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 36: Order TIF was set to DAY based on order preset.', errorCode=10349), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 25, 722789, tzinfo=datetime.timezone.utc), status='ValidationError', message="Warning 2109, reqId 36: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.", errorCode=2109)], advancedError='')\
Error 201, reqId 36: Order rejected - reason:Exchange is closed.\
[16:01:26 ET] BBWI SELL 119 fill=0 status=Inactive\
[16:01:26 ET] Closing 5 shares of AXON...\
Error 10349, reqId 38: Order TIF was set to DAY based on order preset.\
Canceled order: Trade(contract=Stock(conId=272104927, symbol='AXON', exchange='SMART', primaryExchange='NASDAQ', currency='USD', localSymbol='AXON', tradingClass='NMS'), order=MarketOrder(orderId=38, clientId=3, action='SELL', totalQuantity=5, outsideRth=True), orderStatus=OrderStatus(orderId=38, status='Cancelled', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 226688, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 328698, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 38: Order TIF was set to DAY based on order preset.', errorCode=10349)], advancedError='')\
IBKR API validation warning: Trade(contract=Stock(conId=272104927, symbol='AXON', exchange='SMART', primaryExchange='NASDAQ', currency='USD', localSymbol='AXON', tradingClass='NMS'), order=MarketOrder(orderId=38, clientId=3, action='SELL', totalQuantity=5, outsideRth=True), orderStatus=OrderStatus(orderId=38, status='ValidationError', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 226688, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 328698, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 38: Order TIF was set to DAY based on order preset.', errorCode=10349), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 331154, tzinfo=datetime.timezone.utc), status='ValidationError', message="Warning 2109, reqId 38: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.", errorCode=2109)], advancedError='')\
Error 201, reqId 38: Order rejected - reason:Exchange is closed.\
[16:01:26 ET] AXON SELL 5 fill=0 status=Inactive\
[16:01:26 ET] Closing 19 shares of CDW...\
Error 10349, reqId 40: Order TIF was set to DAY based on order preset.\
Canceled order: Trade(contract=Stock(conId=130432552, symbol='CDW', exchange='SMART', primaryExchange='NASDAQ', currency='USD', localSymbol='CDW', tradingClass='NMS'), order=MarketOrder(orderId=40, clientId=3, action='SELL', totalQuantity=19, outsideRth=True), orderStatus=OrderStatus(orderId=40, status='Cancelled', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 825523, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 927483, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 40: Order TIF was set to DAY based on order preset.', errorCode=10349)], advancedError='')\
IBKR API validation warning: Trade(contract=Stock(conId=130432552, symbol='CDW', exchange='SMART', primaryExchange='NASDAQ', currency='USD', localSymbol='CDW', tradingClass='NMS'), order=MarketOrder(orderId=40, clientId=3, action='SELL', totalQuantity=19, outsideRth=True), orderStatus=OrderStatus(orderId=40, status='ValidationError', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 825523, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 927483, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 40: Order TIF was set to DAY based on order preset.', errorCode=10349), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 26, 929693, tzinfo=datetime.timezone.utc), status='ValidationError', message="Warning 2109, reqId 40: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.", errorCode=2109)], advancedError='')\
Error 201, reqId 40: Order rejected - reason:Exchange is closed.\
[16:01:27 ET] CDW SELL 19 fill=0 status=Inactive\
[16:01:27 ET] Closing 9 shares of IBM...\
Error 10349, reqId 42: Order TIF was set to DAY based on order preset.\
Canceled order: Trade(contract=Stock(conId=8314, symbol='IBM', exchange='SMART', primaryExchange='NYSE', currency='USD', localSymbol='IBM', tradingClass='IBM'), order=MarketOrder(orderId=42, clientId=3, action='SELL', totalQuantity=9, outsideRth=True), orderStatus=OrderStatus(orderId=42, status='Cancelled', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 27, 424343, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 27, 527190, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 42: Order TIF was set to DAY based on order preset.', errorCode=10349)], advancedError='')\
IBKR API validation warning: Trade(contract=Stock(conId=8314, symbol='IBM', exchange='SMART', primaryExchange='NYSE', currency='USD', localSymbol='IBM', tradingClass='IBM'), order=MarketOrder(orderId=42, clientId=3, action='SELL', totalQuantity=9, outsideRth=True), orderStatus=OrderStatus(orderId=42, status='ValidationError', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 27, 424343, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 27, 527190, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 42: Order TIF was set to DAY based on order preset.', errorCode=10349), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 27, 529476, tzinfo=datetime.timezone.utc), status='ValidationError', message="Warning 2109, reqId 42: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.", errorCode=2109)], advancedError='')\
Error 201, reqId 42: Order rejected - reason:Exchange is closed.\
[16:01:27 ET] IBM SELL 9 fill=0 status=Inactive\
[16:01:27 ET] Closing 185 shares of CAG...\
Error 10349, reqId 44: Order TIF was set to DAY based on order preset.\
Canceled order: Trade(contract=Stock(conId=5402, symbol='CAG', exchange='SMART', primaryExchange='NYSE', currency='USD', localSymbol='CAG', tradingClass='CAG'), order=MarketOrder(orderId=44, clientId=3, action='SELL', totalQuantity=185, outsideRth=True), orderStatus=OrderStatus(orderId=44, status='Cancelled', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 28, 23840, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 28, 130287, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 44: Order TIF was set to DAY based on order preset.', errorCode=10349)], advancedError='')\
IBKR API validation warning: Trade(contract=Stock(conId=5402, symbol='CAG', exchange='SMART', primaryExchange='NYSE', currency='USD', localSymbol='CAG', tradingClass='CAG'), order=MarketOrder(orderId=44, clientId=3, action='SELL', totalQuantity=185, outsideRth=True), orderStatus=OrderStatus(orderId=44, status='ValidationError', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 28, 23840, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 28, 130287, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 10349, reqId 44: Order TIF was set to DAY based on order preset.', errorCode=10349), TradeLogEntry(time=datetime.datetime(2026, 6, 23, 20, 1, 28, 132021, tzinfo=datetime.timezone.utc), status='ValidationError', message="Warning 2109, reqId 44: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.", errorCode=2109)], advancedError='')\
Error 201, reqId 44: Order rejected - reason:Exchange is closed.\
[16:01:28 ET] CAG SELL 185 fill=0 status=Inactive\
[16:01:28 ET] Force-close complete.\
rafalsoltysek@iMac ~ % \
source ~/.zprofile && /opt/homebrew/bin/python3.11 -c "import json; positions = json.loads(open('open_positions.json').read()); print(f'Open positions: {len(positions)}'); [print(f\"  {p['symbol']}: {p['qty']} shares\") for p in positions]"
[200~source ~/.zprofile && /opt/homebrew/bin/python3.11 -c "import json; positions = json.loads(open('open_positions.json').read()); print(f'Open positions: {len(positions)}'); [print(f\"  {p['symbol']}: {p['qty']} shares\") for p in positions]"~
source ~/.zprofile && /opt/homebrew/bin/python3.11 << 'EOF'\
import json\
positions = json.loads(open('open_positions.json').read())\
print(f'Open positions: {len(positions)}')\
for p in positions:\
    print(f"  {p['symbol']}: {p['qty']} shares @ ${p['entry_price']:.2f}")\
EOF
ls -la | grep -E "open_positions|trades.csv"
sudo pmset -c sleep 0\
sudo pmset -c displaysleep 30
cd ~ && python3.11 -c "\
from ib_async import IB, Stock\
ib = IB()\
ib.connect('127.0.0.1', 7497, clientId=99)\
ib.reqMarketDataType(1)  # live\
c = Stock('AAPL','SMART','USD')\
ib.qualifyContracts(c)\
t = ib.reqMktData(c,'',False,False)\
ib.sleep(3)\
print('Price:', t.last, 'High:', t.high, 'Low:', t.low)\
ib.disconnect()\
"
python3.11 /Users/rafalsoltysek/morning_prefilter.py
python3.11 /Users/rafalsoltysek/scanner.py
FINVIZ_EMAIL=raffal.sol@gmail.com\
FINVIZ_PASSWORD=monako
open -e ~/.env
~/.env
python3 finviz_alert.py
python3 finviz_alert.py
cp ~/finviz_alert.plist ~/Library/LaunchAgents/com.user.finviz_alert.plist\
launchctl load ~/Library/LaunchAgents/com.user.finviz_alert.plist
launchctl list | grep finviz
caffeinate
launchctl load ~/Library/LaunchAgents/com.user.momentum_ngrok.plist
tailscale serve https / http://localhost:8787
tailscale serve --bg http://localhost:8787
tailscale serve --bg http://localhost:8787
tailscale serve --bg http://localhost:8787
tailscale funnel --https=443 off
