Skip to content

Commit

Permalink
Merge pull request #101 from nautechsystems/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
cjdsellers committed Oct 29, 2020
2 parents c489ab1 + 028e1f2 commit 313f78a
Show file tree
Hide file tree
Showing 85 changed files with 1,423 additions and 988 deletions.
10 changes: 0 additions & 10 deletions docs/development/coding_standards.md

This file was deleted.

32 changes: 0 additions & 32 deletions docs/development/data.md

This file was deleted.

31 changes: 0 additions & 31 deletions docs/development/deployment.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/development/documentation.md

This file was deleted.

24 changes: 0 additions & 24 deletions docs/development/packaging.md

This file was deleted.

17 changes: 0 additions & 17 deletions docs/development/testing.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/source/api/common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ Component
:undoc-members:
:member-order: bysource

Constants
---------

.. automodule:: nautilus_trader.common.constants
:show-inheritance:
:inherited-members:
:members:
:undoc-members:
:member-order: bysource

Factories
---------

Expand Down
12 changes: 11 additions & 1 deletion docs/source/api/indicators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ Exponential Moving Average (EMA)
:undoc-members:
:member-order: bysource

Donchian Channel
----------------

.. automodule:: nautilus_trader.indicators.donchian_channel
:show-inheritance:
:inherited-members:
:members:
:undoc-members:
:member-order: bysource

Hull Moving Average (HMA)
-------------------------

Expand Down Expand Up @@ -74,7 +84,7 @@ Average True Range (ATR)
:undoc-members:
:member-order: bysource

Bid Ask Min Max
Bid-Ask Min-Max
---------------

.. automodule:: nautilus_trader.indicators.bid_ask_min_max
Expand Down
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.coverage",
"sphinx.ext.intersphinx",
"sphinx.ext.graphviz",
"sphinx.ext.inheritance_diagram",
"numpydoc",
]

Expand Down Expand Up @@ -76,7 +77,6 @@
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

html_theme = "sphinx_rtd_theme"
Expand All @@ -92,11 +92,11 @@
html_logo = "_static/img/nautilus-black.png"


def skip(app, what, name, obj, would_skip, options):
def skip(app, what, name, obj, would_skip, options): # noqa
if name == "__init__":
return False
return would_skip


def setup(app):
def setup(app): # noqa
app.connect("autodoc-skip-member", skip)
4 changes: 4 additions & 0 deletions docs/source/development/coding_standards.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Coding Standards
- PEP-8 and variations
- Cython specifics
- NumPy docstrings
- flake8 usage and ignores
- pre-commit hook setup and usage
- isort usage
- darglint usage

Code Style
----------
Expand Down
61 changes: 61 additions & 0 deletions docs/source/development/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,64 @@ To run code or tests from the source code, first compile the C extensions for th
$ python setup.py build_ext --inplace

All tests can be run via the `run_tests.sh` script, or through pytest.

Packaging for PyPI
------------------

### CI Pipeline
The CI pipeline will now automatically package passing builds and upload
to PyPI via twine. The below manual packaging instructions are being kept
for historical reasons.

### Manually Packaging
Ensure version has been bumped and not pre-release.

Create the distribution package tar.gz

python setup.py sdist


Ensure this is the only distribution in the /dist directory

Push package to PyPI using twine;

twine upload --repository pypi dist/*

Username is \__token__

Use the pypi token


Internal Data
-------------

Various data is contained internally in the `_data` folder. If file names are
changed ensure the `MANIFEST.in` is updated.

### Libor Rates
The libor rates for 1 month USD can be updated by downloading the CSV data
from https://fred.stlouisfed.org/series/USD1MTD156N

Ensure you select `Max` for the time window.

### Short Term Interest Rates
The interbank short term interest rates can be updated by downloading the CSV
data at https://data.oecd.org/interest/short-term-interest-rates.htm

### Economic Events
The economic events can be updated from downloading the CSV data from fxstreet
https://www.fxstreet.com/economic-calendar

Ensure timezone is set to GMT.

A maximum 3 month range can be filtered and so yearly quarters must be
downloaded manually and stitched together into a single CSV.

Use the calendar icon to filter the data in the following way;

- 01/01/xx - 31/03/xx
- 01/04/xx - 30/06/xx
- 01/07/xx - 30/09/xx
- 01/10/xx - 31/12/xx

Download each CSV
36 changes: 35 additions & 1 deletion docs/source/guides/deploying_live.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
Deploying Live
==============
==============

*** This documentation is currently a work in progress ***

Encryption
----------

For effective remote deployment of a live `TradingNode` which needs to access remote services,
encryption keys must be user generated. The currently supported encryption scheme is that which is built
into ZeroMQ being Curve25519 elliptic curve algorithms. This allows perfect forward security with
ephemeral keys being exchanged per connection. The public `server.key` must be shared with the trader
ahead of time and contained in the `keys\` directory (see below).

To generate a new client key pair from a python console or .py run the following;

.. code-block::

from pathlib import Path

import zmq.auth

keys_dir = 'path/to/your/keys'
Path(keys_dir).mkdir(parents=True, exist_ok=True)

zmq.auth.create_certificates(keys_dir, 'client')

Live Deployment
---------------

The user must assemble a directory including the following;

- `config.json` for configuration settings
- `keys/` directory containing the `client.key_secret` and `server.key`
- `launch.py` referring to the strategies to run
- trading strategy python or cython files
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,3 @@ Index

resources/research
resources/further_reading

2 changes: 1 addition & 1 deletion examples/strategies/ema_cross_cython.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ cdef class EMACross(TradingStrategy):
self.log.info(f"Received {bar_type} Bar({bar})")

# Check if indicators ready
if not self.indicators_initialized():
if not self.indicators_initialized:
self.log.info(f"Waiting for indicators to warm up "
f"[{self.data.bar_count(self.bar_type)}]...")
return # Wait for indicators to warm up...
Expand Down
2 changes: 1 addition & 1 deletion examples/strategies/ema_cross_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def on_bar(self, bar_type: BarType, bar: Bar):
self.log.info(f"Received {bar_type} Bar({bar})")

# Check if indicators ready
if not self.indicators_initialized():
if not self.indicators_initialized:
self.log.info(f"Waiting for indicators to warm up "
f"[{self.data.bar_count(self.bar_type)}]...")
return # Wait for indicators to warm up...
Expand Down
2 changes: 1 addition & 1 deletion nautilus_trader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Semantic Versioning (https://semver.org/)
_MAJOR_VERSION = 1
_MINOR_VERSION = 83
_PATCH_VERSION = 5
_PATCH_VERSION = 8
_PRE_RELEASE = ''

__version__ = '.'.join([
Expand Down
Loading

0 comments on commit 313f78a

Please sign in to comment.