DynamicGreeks is a Python toolkit that recalculates option Greeks after first adjusting implied volatility (IV) with real-time news sentiment generated by a fine-tuned FinBERT model.
- Python 3.9+
- All packages listed in
requirements.txt
(transformers,numpy,pandas,yfinance,newspaper3k, …)
# 1) Clone the repo
git clone https://github.com/<your-handle>/DynamicGreeks.git
cd DynamicGreeks
# 2) (optional) create and activate a virtual environment
python -m venv venv && source venv/bin/activate # Windows: venv\Scripts\activate
# 3) Install dependencies
pip install -r requirements.txtThe FinBERT checkpoint (~420 MB) is downloaded automatically from Hugging Face on first use.
python gui_app.py Prints the GUI interface where the user inputs the news article and options metrics. Returns the IV adjustment, updated Greeks, and a trade analysis in a separate window.
BlackScholes.py # Pricing & Greeks helpers
sentimentMapping.py # sentiment → IV conversion
finalAnalysis.py # decision making and analysis
finetuning.py # FinBERT fine-tuning script
gui_app.py # tkinter interface
dataCleansing.py # text-preprocessing pipeline
baselineModelEvaluation.py # model benchmarks
requirements.txt # required packages
BERT (Bidirectional Encoder Representations from Transformers) learns contextual word embeddings by reading text in both directions.
Pre-training tasks
- Masked-language modeling – predict 15 % masked tokens
- Next-sentence prediction – decide if two sentences are consecutive
The resulting 12-layer encoder (for bert-base) captures subtle, context-dependent meanings.
- Context sensitivity – financial tone hinges on nuanced cues (“guidance missed expectations”).
- Transfer learning – fine-tune quickly on a domain corpus instead of training from scratch.
FinBERT keeps BERT’s architecture but is domain-adapted on ~200 k finance headlines & filings. We fine-tuned it on labelled tweets + articles to classify positive / neutral / negative sentiment with > 90 % F1.
logits → sentiment score *s* ∈ [-1, 1] → ΔIV = α·s
(α is calibrated on historical earnings moves).
The adjusted IV feeds Black-Scholes to update Δ, Γ, Θ, Vega, ρ.
- Fork the repo and create a feature branch
git checkout -b feature/your-feature
- Write tests and run
pytest. - Format code with
black .before committing. - Open a pull request describing your changes.
MIT