Skip to content

Commit 735a33f

Browse files
Merge branch 'master' into black_config
# Conflicts: # CONTRIBUTING.md
2 parents ba54162 + 75449d0 commit 735a33f

File tree

781 files changed

+5097406
-4948346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

781 files changed

+5097406
-4948346
lines changed

CHANGELOG.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Release notes
22

3+
## Version 1.50
4+
5+
- Added optional code to run price collection throughout the day, see [announcement](https://github.com/robcarver17/pysystemtrade/discussions/961)
6+
- Added ability to pass arguments to methods through control_config.yaml
7+
- Added regions to instrument.csv configuration; use interactive_controls, option 5, option 52 to apply
8+
9+
## Version 1.48
10+
11+
- Added new run_ processes, breaking out FX, update sampled contracts, and update multiple/adjusted prices from daily price updates. You will need to update your crontab and control_config.yaml, see **discussion here**
12+
- Refactoring syscore
13+
- Changed handling of expensive instruments, [see this discussion](https://github.com/robcarver17/pysystemtrade/discussions/938)
14+
- Added requirement for BLACK [see this discussion](https://github.com/robcarver17/pysystemtrade/discussions/921)
15+
- Roll report clean up format [discussed here](https://github.com/robcarver17/pysystemtrade/discussions/864)
16+
- Gradual removal of missing_data, missing_contract type objects and replace with exceptions
17+
- Algos won't be allocated just before day end [discussed here](https://github.com/robcarver17/pysystemtrade/discussions/853)
18+
- Timezones can now be manually configured [discussed here](https://github.com/robcarver17/pysystemtrade/discussions/845)
19+
- Auto copying of instrument config data between db and csv
20+
- Utility to cross check IB configuration multipliers
21+
- Utility to delete instrument data
22+
- Custom private directory
23+
- Utility to modify roll config
24+
325
## Version 1.47
426

527
- fix for #729. Added hourly and daily per contract prices IMPORTANT YOU MUST RUN /sysinit/futures/create_hourly_and_daily.py from the command line to create hourly and daily data.
@@ -189,7 +211,7 @@ Note that the large contract prices will continue to be updated (best to keep do
189211

190212
## Version 0.51.0
191213

192-
- Essentially 'finished' production.md (in as much as anything can be finished...)
214+
- Essentially 'close' production.md (in as much as anything can be close...)
193215
- Changed data Blobs so now take lists of objects rather than str, easier to see dependencies
194216

195217
## Version 0.50.0
@@ -260,7 +282,7 @@ Note that the large contract prices will continue to be updated (best to keep do
260282

261283
## Version 0.23.0
262284

263-
- 'get_filename_for_package' can now take absolute as well as relative paths, and can cope with separate file names
285+
- 'resolve_path_and_filename_for_package' can now take absolute as well as relative paths, and can cope with separate file names
264286
- Updated legacy .csv files
265287
- Fixed a few bugs
266288
- Can now get unexpired contracts for a given instrument using 'contractDateWithRollParameters.get_unexpired_contracts_from_now_to_contract_date()'
@@ -481,7 +503,7 @@ Moved most examples except core to separate git [here](https://github.com/robcar
481503

482504
* Added methods to accountCurveGroup.get_stats(): .mean(), .std(), .tstat(), .pvalue()
483505
* Added method to accountCurveGroup stack; stack object can also produce bootstrap
484-
* Added account_test(ac1, ac2) to produce a t-test statistic for any two account curve like objects.
506+
* Added account_t_test(ac1, ac2) to produce a t-test statistic for any two account curve like objects.
485507

486508
## Version 0.6.0
487509

CONTRIBUTING.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# pysystemtrade contributing guide
1+
# Pysystemtrade contributing guide
22

33

4-
## unit tests
4+
## Unit tests
55
This project has a few unit tests. They get run automatically when any PR is
66
submitted. You'll see the result of the run in the PR page. To run the tests
77
yourself locally, before submitting, you'll need `pytest` installed. Then run:
@@ -27,7 +27,7 @@ pytest --runslow
2727
```
2828

2929

30-
## lint
30+
## Lint / Black
3131

3232
This project keeps its code pretty with
3333
[Black](https://black.readthedocs.io/en/stable/). Black gets automatically run
@@ -50,4 +50,42 @@ as you commit. Configuration instructions
5050

5151
### Black version
5252

53-
Black needs to be consistent between the version running in the CI build and your local environment. To check the currently used version, see the [GitHub action config](https://github.com/robcarver17/pysystemtrade/blob/master/.github/workflows/lint.yml)
53+
Black needs to be consistent between the version running in the CI build and your local environment. To check the currently used version, see the `[tool.black]` section of the project TOML file (https://github.com/robcarver17/pysystemtrade/blob/master/pyproject.toml)
54+
55+
## General code guidelines (INCOMPLETE)
56+
57+
These guidelines are aspirations, and do not describe the system as it stands. The project has been written over a period of several years, and it is only quite recently I've decided to set out some guidelines.
58+
59+
In general, we try and follow the original texts: [PEP 8](https://peps.python.org/pep-0008/) and [clean code](https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29).
60+
61+
### General
62+
63+
- Unless there is a single parameter, passed parameters should be explicit.
64+
- It is almost always better to use `arg_not_supplied` (`from syscore.objects import arg_not_supplied`) as a default argument then resolve it to the appropriate value in the function.
65+
- Type hints should be used, with Unions if required `from typing import Union` and Lists / Dicts ...`from typing import List, Dict`
66+
- Verbose doc strings specifying all the parameters are no longer required (superseded by type hints)
67+
68+
### Naming conventions
69+
70+
- For classes, I prefer mixedCase to CamelCase, but single word names should always be Camels.
71+
- Common methods are `get`, `calculate`, `read`, `write`.
72+
- There is a specific procedure for naming objects which form part of the data heirarchy, see [here](https://github.com/robcarver17/pysystemtrade/blob/master/docs/data.md#part-2-overview-of-futures-data-in-pysystemtrade). If this is not followed, then the [automated abstraction of data inside Data 'blob' instances](https://github.com/robcarver17/pysystemtrade/blob/master/docs/data.md#data-blobs) won't work.
73+
- Although arguably redundant, I am a fan of describing eg objects that inherit from dicts with a dict_ prefix. This gives hints as to how they behave without having to look at their code.
74+
75+
76+
### Error handling
77+
78+
- Production code should not throw an error unless things are completely unrecoverable; if it does throw an error it must also log.critical which will email the user
79+
80+
81+
### Caching
82+
83+
FIXME This is a bit of a mess - Update when a unified cache system setup
84+
85+
86+
### Testing
87+
88+
Doc tests should be removed from class methods, since they often require a lot of setup, and make the code harder to read. Unit tests are preferable.
89+
Doc tests make more sense for seperate, standalone, functions. This is especially the case when they can be used to quickly demonstrate how a function works.
90+
91+
Test coverage is extremely sparse.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# pysystemtrade
22

3-
Systematic Trading in python
3+
Systematic futures trading in python
44

55
Rob Carver
66

77
[https://qoppac.blogspot.com/p/pysystemtrade.html](https://qoppac.blogspot.com/p/pysystemtrade.html)
88

99

10-
Version 1.47
10+
Version 1.50
1111

1212

13-
2022-08-31
13+
2023-01-27
1414

1515

1616

@@ -26,7 +26,7 @@ See [DONE_TO_DO](CHANGELOG.md) for release notes, and future plans.
2626
For a longer explanation of the motivation and point of this project see my [blog post.](https://qoppac.blogspot.com/2015/12/pysystemtrade.html)
2727

2828
Pysystemtrade is a....:
29-
- Backtesting environment that will work "out of the box" for chapter 15 of my book ["Systematic Trading"](https://www.systematicmoney.org/systematic-trading)
29+
- Backtesting environment I used to test all the strategies in my various ["books"](https://www.systematicmoney.org)
3030
- Which implements all the optimisation and system design principles in the book and on my website and in my books
3131
- A fully automated system for futures trading (for interactive brokers)
3232

0 commit comments

Comments
 (0)