Git Product home page Git Product logo

finmarketpy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

finmarketpy's Issues

Errors when trying to run fx_options_indices_examples

Before anything, Id like to say big thanks for all this material. Very useful to FX Options community and traders in the world.
I'm new to python coding, so Im sorry if Im making any mistakes.

When trying to run fx_options_indices_examples.py, I get some errors related to some of financepy module imports. I noticed that two diff modules from finmarketpy, fxoptionspricer.py and fxvolsurface.py, call for diff import commands - fxoptionspricer.py uses 0,193 financepy file structure (modules names start with "Fin") while fxvolsurface.py uses financepy 0.22 format.

running the code with 0.193 version of financepy, this is one of the errors that I get: "ModuleNotFoundError: No module named 'financepy.utils'"

what am I doing wrong here? Is it possible to fix it by running two versions of financepy ?

Thanks and regards,
Vinicius

Chartpy - Empty chart

Hi there,

Firstly, thank you for three excellent projects. Only recently have I tried plotting a chart using Chartpy. And this has been unsuccessful. I am struggling to figure out why the chart output is not being rendered. I get a PNG and matplotlib display that is blank. The logs are:

2019-08-10 17:38:28,860 - findatapy.market.datavendorweb - INFO - Request AlphaVantage data
2019-08-10 17:38:30,496 - findatapy.market.datavendorweb - INFO - Completed request from Alpha Vantage for ['VUSA.open', 'VUSA.high', 'VUSA.low', 'VUSA.close', 'VUSA.volume']
2019-08-10 17:38:32,513 - findatapy.market.ioengine - WARNING - Couldn't push MarketDataRequest_527__abstract_curve_key-None__alpha_vantage_api_key-x__category-None__category_key-backtest_default-cat_alphavantage_intraday_NYC_VUSA__cut-NYC__data_source-alphavantage__environment-backtest__expiry_date-NaT__fields-open_high_low_close_volume__finish_date-2019-08-10 16:38:27_377636__fred_api_key-x__freq-intraday__freq_mult-1__gran_freq-None__quandl_api_key-x__resample-None__resample_how-last__start_date-2019-08-03 16:38:28_406628__tickers-VUSA__trade_side-trade__vendor_fields-open_high_low_close_volume__vendor_tickers-VUSA_L to Redis: Error 10061 connecting to 127.0.0.1:6379. No connection could be made because the target machine actively refused it.
2019-08-10 17:38:32,749 - matplotlib.legend - WARNING - No handles with labels found to put in legend.

I would really appreciate any thoughts or suggestions.

Thanks

Fig

error when calling LightTimeSeriesFactor with Bloomberg

df = ltsf.harvest_time_series(time_series_request)
Traceback (most recent call last):
File "", line 1, in
File "C:\Anaconda2\lib\site-packages\pythalesians-0.1a0-py2.7.egg\pythalesians\market\loaders\lighttimeseriesfactory.py", line 126, in harvest_time_series
loader = self.get_loader(time_series_request.data_source)
File "C:\Anaconda2\lib\site-packages\pythalesians-0.1a0-py2.7.egg\pythalesians\market\loaders\lighttimeseriesfactory.py", line 93, in get_loader
loader = LoaderBBGOpen()
File "C:\Anaconda2\lib\site-packages\pythalesians-0.1a0-py2.7.egg\pythalesians\market\loaders\lowlevel\bbg\loaderbbgopen.py", line 41, in init
super(LoaderBBGOpen, self).init()
TypeError: must be type, not classobj

platform.platform() doesn't just yield 'mac' [AttributeError: 'MarketConstants' object has no attribute 'generic_plat']

We get more detailed platform information now

>>> import platform
>>> platform.platform()
'macOS-10.15.7-x86_64-i386-64bit'

This causes the backtesting engine to fail on modern macbooks

AttributeError                            Traceback (most recent call last)
<ipython-input-12-80a29ff8827d> in <module>
----> 1 model.construct_strategy()

/usr/local/anaconda3/envs/qtrade/lib/python3.8/site-packages/finmarketpy/backtest/backtestengine.py in construct_strategy(self, br, run_in_parallel)
   1074 
   1075         # each portfolio key calculate returns - can put parts of the portfolio in the key
-> 1076         if market_constants.backtest_thread_no[market_constants.generic_plat] > 1 and run_in_parallel:
   1077             swim_pool = SwimPool(multiprocessing_library=market_constants.multiprocessing_library)
   1078 

AttributeError: 'MarketConstants' object has no attribute 'generic_plat'

Python 3 vs Python 2.7

First, Thanks very much and congratulation on the first release of pythalesians!!!

I am not sure whether "Github Issue" is the right place to ask question so please let me know if it is not.

Could you please share some of your thought why you prefer to start with python 3 instead of python 2.7? I thought the mainstream for data analysis is still python 2.7 or this is no longer the case? cheers

Where is the api documentation? How are we supposed to use it?

Doesn't even see a list of functions/methods to be used, let alone a basic documentation.
and I have googled around and there just isn't any documentation of this library.
How can we use it without the most basic understanding of the library?
You have to at least create a documentation page and list out all the classes and functions right?

spread trading costs

Hi,

nice library! I have a question, is finmarketpy considering spread trading costs?

Kindly let me know.
Thanks.

Regards.

backtest-example(second version) fails

I've taken out a second example into separate file from finmarketpy_examples/backtest_example.py

Created a clean env and still getting the error.
I guess it's something to do with changes in finmarketpy/backtest/backtestengine.py 2 weeks ago.

signals = backtest.get_porfolio_signal() # get final signals for each series
AttributeError: 'Backtest' object has no attribute 'get_porfolio_signal'

image

TA-lib library?

Hi, does this framework has the TA-lib library implemented too or is it something easy for me to "just use"?
Thanks

Pipelining / stacking strategies

Hey Saeed - been looking your finmarketpy library - looks nice!

What wasn't clear to me from looking at it was if you can stack strategies upon each other?

For example:

  • I have 4 building-block strats which solely roll commodity futures contracts.
  • I have 2 strategies, say Seasonality and Momentum taking roll strats as an underlying "asset".
  • Combine as a portfolio with some smart switching taking all 8 as inputs

Is that achievable ?

I couldn't see how it would be set up and return risk metrics at each constituent level.

Project goals, comparison with zipline

It would be great to have a a short section on project goals/philosophy and how it differs from existing libraries like quantopian/zipline, QuantLib, etc.

Plotting for HF data

Matplotlib is extremely slow at handling lots of data.

Suggest resampling kwarg for plotting to resample on a new time horizon

Incorrect strike property setter

In market/request/backtestrequest.py, the strike property setter is using the tenor decorator.

@tenor.setter
def strike(self, strike):
    self.__strike = strike

only available returns are cumprod

Currently the only returns available are cumulative products.
I couldn't find any alternative to Calculations().create_mult_index() for cumulative sums

Suggest cumulative sum flag when calculating backtest cumulative PnL

ImportError: cannot import name 'ols'

i got error "ImportError: cannot import name 'ols'"
what am i missing?

Traceback (most recent call last):
File "C:/Users/lei.wang/AppData/Local/Continuum/Anaconda3/Lib/site-packages/finmarketpy_examples/backtest_example.py", line 30, in
from finmarketpy.backtest import BacktestRequest, Backtest
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\finmarketpy_init_.py", line 1, in
from finmarketpy import (backtest, economics, util)
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\finmarketpy\backtest_init_.py", line 3, in
from finmarketpy.backtest.backtestengine import Backtest
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\finmarketpy\backtest\backtestengine.py", line 17, in
from findatapy.util import LoggerManager
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy_init_.py", line 3, in
from findatapy import (market, timeseries, util)
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy\market_init_.py", line 8, in
from findatapy.market.market import Market, FXVolFactory, FXCrossFactory, FXConv
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy\market\market.py", line 461, in
from findatapy.timeseries import Calculations, Filter, Timezone
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy\timeseries_init_.py", line 6, in
from findatapy.timeseries.calculations import Calculations
File "C:\Users\lei.wang\AppData\Local\Programs\Python\Python36-32\lib\site-packages\findatapy\timeseries\calculations.py", line 23, in
from pandas.stats.api import ols
ImportError: cannot import name 'ols'

Installing arctic on Windows 10 with Anaconda Prompt and pip

Ran into an Anaconda problem when trying to install arctic:
(C:\Users\User-pc\Anaconda3) C:\Users\User-pc>pip install git+https://github.com/manahl/arctic.git

This would result in the following error:
error: command 'cl.exe' failed: No such file or directory

Even after setting the PATH variables, I had no luck.

The solution, is to run pip inside the VC directory where cl.exe is located:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>pip install git+https://github.com/manahl/arctic.git

IPython/Jupyter notebooks

Hello,

IPython/Jupyter notebooks could be a great tool to use to show some features of pythalesians.

Kind regards

AttributeError: 'DataConstants' object has no attribute 'base_depos_tenor'

Hi Saeed,

Cuemacro is a brilliant suite of libraries. Thanks for your efforts.

I was trying out an example in (finmarketpy_examples) where I received this error:

base_depos_tenor=data_constants.base_depos_tenor,
AttributeError: 'DataConstants' object has no attribute 'base_depos_tenor'

Any idea why I am receiving this error?

Thanks again,
Abhi

Installing findatapy on Windows 10

A problem that popped up with installing findatapy:

blosc could not be compiled, this got fixed by downloading the blosc wheel, and installing this first (since it is a dependency) using
pip install path_to_blosc_wheel\blosc-****.whl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.