Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production Docs: FX data: Initialise the spot FX data in MongoDB from .csv files; error in repocsv_spotfx_prices.py #1346

Closed
joshwigginton opened this issue Feb 29, 2024 · 1 comment

Comments

@joshwigginton
Copy link

I am setting up a production instance and following the guide and ran into an issue. The guide mentions:

FX data:
Initialise the spot FX data in MongoDB from .csv files (this will be out of date, but you will update it in a moment)

Running:
pysystemtrade/blob/master/sysinit/futures/repocsv_spotfx_prices.py

I get the following error:
Traceback (most recent call last):
File "/home/josh/pysystemtrade/sysinit/futures/repocsv_spotfx_prices.py", line 26, in
db_fx_price_data.add_fx_prices(
File "/home/josh/pysystemtrade/sysdata/fx/spotfx.py", line 176, in add_fx_prices
if self.is_code_in_data(code):
File "/home/josh/pysystemtrade/sysdata/fx/spotfx.py", line 167, in is_code_in_data
if code in self.get_list_of_fxcodes():
File "/home/josh/pysystemtrade/sysdata/fx/spotfx.py", line 234, in get_list_of_fxcodes
raise NotImplementedError(USE_CHILD_CLASS_ERROR)
NotImplementedError: You need to use a child class of fxPricesData

My workaround:
I was able to make this change to fix it. I am just learning the system/code, not sure if this is the best fix or will cause other issues.

  # Old code line nine in repocsv_spotfx_prices.py
  # db_fx_price_data = fxPricesData()
  
  # Use csvFxPricesData instead of fxPricesData
  db_fx_price_data = csvFxPricesData()  
@joshwigginton joshwigginton changed the title Production Docs: FX data: Initialise the spot FX data in MongoDB from .csv files Production Docs: FX data: Initialise the spot FX data in MongoDB from .csv files; error in repocsv_spotfx_prices.py Feb 29, 2024
@robcarver17
Copy link
Owner

Well that is a bit pointless as you will just read in csv prices and write to csv prices!!!

fixed in last commit (develop branch)

CEllis40 added a commit to CEllis40/pysystemtrade that referenced this issue Mar 12, 2024
* final piece of long only DO

* final piece of long only DO

* final piece of long only DO

* merge latest, black

* final piece of long only DO

* tell Black to ignore one line

https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html

* fix to issue with reduce only and no trade in DO

* fix to issue with reduce only and no trade in DO

* can now pass constraint functions to DO

* die

* Improve log messages when there is a problem emailing a report

(cherry picked from commit ca311cc)

* Fix stack handler bug

(cherry picked from commit 4de5eba)

* Fix stack handler bug

(cherry picked from commit 8488b99)

* fix net position error in roll code

* checked into wrong branch

* starting to build in parquet

* starting to build in parquet

* parquet create files

* parquet create files

* parquet create files

* missing extension

* missing extension

* added backup function

* added capital

* deal with ts in parquet

* replace arctic adjusted prices with parquet - read the discussion!

* single point of xfer

* single point of xfer

* reorder backup order;

* use parquet rather than arctic capital

* revert to arctic capital

* add explicit column name to capital df

* revert to parquet capital

* revert to parquet capital

* contract prices in backup

* change ident repr for contracts and freq

* per contract prices

* much cleaner way to switch arctic/parquet

* bug

* bug

* bug

* bug

* bug

* removed redundant pointers.py

* removed all direct arctic references

* fixed backup

* fixed backup

* fix for class adding

* accident indent

* accident indent

* added multiple price backup for parquet

* parquet backup now skips if already done

* parquet backup now skips if already done

* default is now parquet for multiple prices

* default is now parquet for multiple prices

* back up to parquet now interactive

* added fx to backup

* added fx to backup

* parquet now default for fx

* weird error fixed

* weird error fixed

* confusion over spread data

* added historic spreads to backup

* switched default of spread to parquet

* added optimal position data

* switched optimal positions to parquet

* added position data to backup

* added position data to backup

* added position data to backup

* added position data to backup

* added position data to backup

* switched default for position storage to parquet

* added parquet backup changed control config

* accidentally wrote over setup and requirements

* accidentally wrote over setup and requirements

* black and started tweaking codde to run

* Update backup_parquet_data_to_remote.py

* Update backup_parquet_data_to_remote.py

* fix weird IB date string

* fix future warning

* fix future warning

* fixed .append issue

* supress warning fix bfill error

* fixed append in margn

* now correct warning syntax

* fixed backup issue

* slippage reporting append error

* update spread costs

* removed annoying warning from volumes

* removed annoying warning from contract positions

* fix append error in trade reporting

* fix append error in pandl reporting

* fix append error in trade reporting

* removed future warning from pandl calculator

* removed warning from capital data

* more pandas fixes

* remove warning in price changes

* updated version

* bug reading spread data

* arctic was still in setup and requirements

* blacked

* update Black version to 23.11.0

* quick test runs python 3.10

* HANG-TECH --> HANGTECH in spread costs

(cherry picked from commit a372c5c)

* slow test runs python 3.10

* python 3.10.13

* add a default parquet store to config

* fix date format in algo tests

* fix date format in roll config tests

* EDOLLAR -> SOFR

* undo monkeypatch work

* skip weird 'ufunc' failing test

* filter out nans with pd.isnull(), and convert to numeric with pd.to_numeric()

* unskip test

* fix robcarver17#1296

* couple more new pandas issues

* Update strategy_functions.py

* Update vol.py

can now forward and backfill in chained method

* remove future warning

* remove future warning properly speed up percentage calculation

* fix project name

* black

* black

* refactor away uses of log_with_attributes() in the algo code

* refactoring away specific_log()

* additional logger test for method 'clear'

* refactor away uses of log_with_attributes() in the order and stack handler code

* refactor away uses of log.setup() in fx code

* Update vol.py

* Formula fixes in risk report header

* fix

* black

* docs: update ARM64 MacOS installation instructions

* Update installation.md

Fix suspected typo in command line for apple silicon.

* Update setup.py

Versions of 'matplotlib' beyond 3.8.0 do not offer support for Python 3.8.

* repointing data refs to rawdata refs to make it easier to override

* repointing data refs to rawdata refs to make it easier to override

* repointing data refs to rawdata refs to make it easier to override

* black

* remove references to log.setup() from comments and messages

* remove references to log.setup() from POC

* removing log.setup() tests

* removing setup() from adapter

* removing reference to pst_logger

* logging docs updated

* link to python 3.10 logging docs

* remove old POC logging doc

* temp override needs to handle missing data

* black

* spelling

* grammar

* fix shadow cost default

* spelling

* spelling

* spelling

* spelling

* inherite -> inherit

* augemented -> augmented

* overriden -> overridden

* spelling

* grammar

* raise Exception, not str

* Can only see emails now, not logs or errors

* fix menu ID for broker orders

* ago -> algo

* missing )

* type not constructor

* black

* print branch name in job

* remove unused method _resolve_names_and_add()

* attempt to fix log error

* replace futures_contract_object.log() with temp log_attributes()

* Correct IBEX spread cost entry

* initial

* new docs doc outlining some recent changes

* installation doc updated for new dependencies

* link to new recent_changes doc

* link to new recent_changes doc, TOC rebuilt

* fix slow tests in master

* black

* latest action versions

* Update instrumentconfig.csv

* Update instrumentconfig.csv

* Update spreadcosts.csv

* Revert "Updating commissions and spreadcosts based on my observations"

* setup not properly merged

* fixes split frequency price file support -  no longer using '/' character

* adds support for import of split frequency price files

* link to bc-utils usage guide

* allow csv_data_path to be passed to __init__()

* fix version so it matches CHANGELOG

* also generating merged prices when importing split frequency CSV prices

* Bump pyyaml from 5.3.1 to 5.4

Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4.
- [Changelog](https://github.com/yaml/pyyaml/blob/main/CHANGES)
- [Commits](yaml/pyyaml@5.3.1...5.4)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix robcarver17#1346

* updated some commissions on new instruments

* commit

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: rob <robcarver17@googlemail.com>
Co-authored-by: Andy Geach <andy@bugorfeature.net>
Co-authored-by: Robert Carver <robcarver17@users.noreply.github.com>
Co-authored-by: todd <3578666+tgibson11@users.noreply.github.com>
Co-authored-by: Rob Carver <robcarver17@gmail.com>
Co-authored-by: Mendel Friedman <77807315+meldinman@users.noreply.github.com>
Co-authored-by: yuntai <yuntai@users.noreply.github.com>
Co-authored-by: Hari Limaye <harilimaye@gmail.com>
Co-authored-by: Abhishek Kumar <abhishek@corewars.org>
Co-authored-by: fafuja <46684536+fafuja@users.noreply.github.com>
Co-authored-by: Matthijs Vákár <m.i.l.vakar@uu.nl>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants