unable to import optopsy
kaushik1105 opened this issue · 5 comments
@michaelchu unable to import optopsy
runfile('G:/Projects/python/options/opto/strategies/sample_strategy.py', wdir='G:/Projects/python/options/opto/strategies')
Traceback (most recent call last):
File "", line 1, in
runfile('G:/Projects/python/options/opto/strategies/sample_strategy.py', wdir='G:/Projects/python/options/opto/strategies')
File "C:\Users\kaushik\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 668, in runfile
execfile(filename, namespace)
File "C:\Users\kaushik\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "G:/Projects/python/options/opto/strategies/sample_strategy.py", line 1, in
import optopsy as op
ModuleNotFoundError: No module named 'optopsy'
Was the library installed into your python environment via pip?
@michaelchu
I think I solved the problem by creating a clone of my anaconda3 folder.
Now i am not getting the error. But I am trying to run the file and getting a result 0 profit.
I am just trying to read the code as you mention data SPX_2016 but the data i am getting of 2015.
I am trying to solve the issue.
Disclaimer: I am very new to python. But I found your database is very useful for backtesting.
Thanks for trying my library, it does not come with data however, what is the format of your data source?
Thanks Michael, you are really helpful.
I changed it SPX_2015 which I got from your link
quote
"The sample strategy can be used with Level 2 Historical CSV Data Sample from historicaloptiondata.com."
unquote
and change the date
start =datetime (2015,1,1)
end=datetime(2015,12,31)
its working fine.
you can close issue now.
I will mail you regarding some other information.
Glad to hear! Let me know if you run into any other issues!