OpenClaw Trading - Jupyter Notebooks
Interactive tutorials for learning OpenClaw Trading.
Prerequisites
Install Jupyter:
pip install jupyter matplotlib pandas
Install OpenClaw:
pip install -e ".."
Or set PYTHONPATH:
export PYTHONPATH=/path/to/openclaw/src:$PYTHONPATH
Starting Jupyter
jupyter notebook
This will open a browser window with the notebook interface.
Available Notebooks
01_getting_started.ipynb
Introduction to OpenClaw Trading basics:
- Creating an economic tracker
- Simulating trades
- Tracking performance
- Visualizing balance history
- Comparing different strategies
Duration: 15-20 minutes
02_agent_comparison.ipynb
Compare different types of agents:
- Market Analyst vs Sentiment Analyst
- Impact of skill levels
- Factor performance comparison
- Agent survival rates
Duration: 20-30 minutes
03_backtesting.ipynb
Learn backtesting strategies:
- Running simple backtests
- Parameter optimization
- Walk-forward analysis
- Performance visualization
Duration: 25-35 minutes
04_custom_strategies.ipynb
Create custom trading strategies:
- Building custom agents
- Creating custom factors
- Strategy optimization
- Advanced backtesting
Duration: 30-45 minutes
Running the Notebooks
-
Start Jupyter:
jupyter notebook -
Click on a notebook file (.ipynb)
-
Run cells with:
Shift+Enter: Run current cell and move to nextCtrl+Enter: Run current cell and stayCell > Run All: Run all cells
-
To restart:
Kernel > Restart & Clear Output: Start freshKernel > Restart & Run All: Restart and run all
Tips
- Run cells in order (top to bottom)
- If you get errors, try
Kernel > Restart & Run All - Modify the code and experiment!
- Check the documentation for more details
Troubleshooting
Module Not Found
If you get ModuleNotFoundError, ensure:
- OpenClaw is installed:
pip install -e ".." - PYTHONPATH is set correctly
- You're running Jupyter from the notebooks directory
Plot Not Showing
If plots don't display:
%matplotlib inline
Add this at the beginning of the notebook.
Kernel Crashes
If the kernel crashes:
Kernel > RestartCell > Run All Above(to get back to where you were)- Continue from there