IV-League-DAO / option-trading-simulator

option trading-simulator
MIT License
0 stars 1 forks source link
monte-carlo options options-trading

Option-research

Analyze multiple trading strategies on options.

Installation

pip install -r requirements.txt

Path generation:

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 .pickle file.

Simulate strategy

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"

Strategies

AbstractStrategy

This strategy does not apply any hedging during the simulation.

DeltaIntervalHedgeStrategy

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"

DeltaNonPositiveHedgeStrategy

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" 

Output Files

Graph generation

You can generate graphs using the createGraphs.ipynb. Just edit parameters section with correct values.