Analyze multiple trading strategies on options.
pip install -r requirements.txt
This command will generate paths for the simulation into runGen folder. For more information run this command with --help
argument.
python3 generateRuns.py --saveDir <output_path> -p <num_path> --pricesFile Gemini_ETHUSD1h_unixFix.csv
<output_path>
: directory where your run generations will be stored (generateRuns) already exists as a default
<num_paths>
: number of paths you wish to generate for your simulation runs
This will generate
Now, we can run the strategy simulation on the generated paths:
For more information run this command with --help
argument.
Default strategy (Without hedging strategy)
python3 runStrategy.py -m 1.0 0.5 -s 0.8 1.0 -c 2 --saveDir <outputFolder> -r <num_path>.pickle --strategy AbstractStrategy --ivc 0.05 --initPrice 2000 --calls
Hedging strategy
python3 runStrategy.py -m 1.0 0.5 -s 0.8 1.0 -c 2 --saveDir <outputFolder> -r <num_path>.pickle --strategy DeltaIntervalHedgeStrategy --ivc 0.05 --initPrice 2000 --calls --strategyArgs 1:h " -0.4:float" " -0.5:float"
This strategy does not apply any hedging during the simulation.
This strategy tries to keep the delta of the pool inside the given interval.
Example how to run:
python3 runStrategy.py -m 1.0 -s 0.8 -c 4 --saveDir runGen -r runGen/100.pickle --strategy DeltaIntervalHedgeStrategy --ivc 0.05 --initPrice 2000 --calls --strategyArgs 1:h " -0.4:float" " -0.5:float"
This strategy keeps delta negative only, but within defined range.
Example how to run:
python3 runStrategy.py -m 1.0 -s 0.8 -c 4 --saveDir runGen -r runGen/100.pickle --strategy DeltaNonPositiveHedgeStrategy --ivc 0.05 --initPrice 2000 --calls --strategyArgs 1:h " -0.5:float"
You can generate graphs using the createGraphs.ipynb. Just edit parameters section with correct values.