For educational purposes only. Trading involves substantial risk of loss. Not financial advice.
Getting Started
Get Mahoraga running in 10 minutes.
Prerequisites
- Node.js 18 or higher
- Alpaca account (free, supports paper trading)
- OpenAI API key (for LLM analysis)
1. Clone and Install
git clone https://github.com/ygwyg/MAHORAGA.git
cd MAHORAGA
npm install
cd dashboard && npm install && cd ..
2. Configure API Keys
Create a .dev.vars file in the project root:
ALPACA_API_KEY=your_alpaca_key
ALPACA_API_SECRET=your_alpaca_secret
ALPACA_PAPER=true
OPENAI_API_KEY=your_openai_key
KILL_SWITCH_SECRET=any_random_string_here
Important: Always start with ALPACA_PAPER=true until you understand how the system works.
3. Get Your API Keys
Alpaca (Required)
- Create a free account at alpaca.markets
- Go to Paper Trading → API Keys
- Click Generate New Keys
- Copy both the key and secret to
.dev.vars
OpenAI (Required)
- Create an account at platform.openai.com
- Add billing and credits ($10 is plenty to start)
- Go to API Keys → Create new secret key
- Add to
.dev.vars: OPENAI_API_KEY=sk-your_key
Estimated costs: ~$0.50-2/day using gpt-4o-mini, depending on trading activity.
4. Start the MCP Server
npm run dev
The server runs at http://localhost:8787
5. Start the Trading Agent
In a new terminal:
node agent-v1.mjs
The agent will start monitoring StockTwits and making trading decisions.
6. Open the Dashboard (Optional)
In another terminal:
cd dashboard
npm run dev
Open http://localhost:5173 in your browser to monitor:
- Account balance and positions
- Current signals and research
- Agent activity logs
- LLM cost tracking
What Happens Next
The agent runs in a loop:
- Data gathering (24/7) — Fetches trending stocks from StockTwits
- LLM research — Analyzes top signals for red flags and catalysts
- Trading (market hours) — Executes buy/sell based on LLM decisions
- Position management — Monitors held positions for exit signals
Next Steps