Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 12 additions & 44 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@

## Contribute to the value investing bot

Feel like our bot is missing a feature? We welcome your pull requests!
Feel like the framework is missing a feature or can be fixed? We welcome your pull requests!

Few pointers for contributions:

- Create your PR against the `develop` branch, not `master`.
- Create your branch against the `develop` branch, not `master`.
- New features need to contain unit tests and must be PEP8 conformant (max-line-length = 100).
- Creating a feature, must be done on a branch with prefix `feature_`.
- Making a hotfix, must be done on a branch with prefix `hotfix_`.

If you are unsure, discuss the feature on our [Slack](https://join.slack.com/t/investingbots/shared_invite/enQtODgwNTg3MzA2MjYyLTdiZjczZDRlNWJjNDdmYThiMGE0MzFhOTg4Y2E0NzQ2OTgxYjA1NzU3ZWJiY2JhOTE1ZGJlZGFiNDU3OTAzMDg)
If you are unsure, discuss the feature or hotfix on our [Slack](https://inv-algo-framework.slack.com)
or in a [issue](https://github.com/investingbots/value-investing-bot/issues) before a PR.

## Getting started

## Before sending the PR:
## Rules

### 1. Run unit tests

Expand Down Expand Up @@ -46,55 +44,22 @@ pytest tests/test_<file_name>.py::test_<method_name>
#### Run Flake8

```bash
flake8 bot
flake8 investing_algorithm_framework
```

We receive a lot of code that fails the `flake8` checks.
To help with that, we encourage you to install the git pre-commit
hook that will warn you when you try to commit code that fails these checks.
Guide for installing them is [here](http://flake8.pycqa.org/en/latest/user/using-hooks.html).

### 3. Test if all type-hints are correct

#### Run mypy

``` bash
mypy bot
mypy investing_algorithm_framework
```

## (Core)-Committer Guide

### Process: Pull Requests

How to prioritize pull requests, from most to least important:

1. Fixes for broken tests. Broken means broken on any supported platform or Python version.
1. Extra tests to cover corner cases.
1. Minor edits to docs.
1. Bug fixes.
1. Major edits to docs.
1. Features.

Ensure that each pull request meets all requirements in the Contributing document.

### Process: Issues

If an issue is a bug that needs an urgent fix, mark it for the next patch release.
Then either fix it or mark as please-help.

For other issues: encourage friendly discussion, moderate debate, offer your thoughts.

### Process: Your own code changes

All code changes, regardless of who does them, need to be reviewed and merged by someone else.
This rule applies to all the core committers.

Exceptions:

- Minor corrections and fixes to pull requests submitted by others.
- While making a formal release, the release manager can make necessary, appropriate changes.
- Small documentation changes that reinforce existing subject matter. Most commonly being, but not limited to spelling and grammar corrections.

### Responsibilities

- Ensure cross-platform compatibility for every change that's accepted. Windows, Mac & Linux.
Expand All @@ -107,11 +72,14 @@ Exceptions:

Contributors may be given commit privileges. Preference will be given to those with:

1. Past contributions to value investing btot and other related open-source projects. Contributions to value investing bot include both code (both accepted and pending) and friendly participation in the issue tracker and Pull request reviews. Quantity and quality are considered.
1. Past contributions to value investing algorithm framework and other related open-source projects.
Contributions to value for the framework include both code (both accepted and pending) and friendly participation in the issue tracker and Pull request reviews. Quantity and quality are considered.
1. A coding style that the other core committers find simple, minimal, and clean.
1. Access to resources for cross-platform development and testing.
1. Time to devote to the project regularly.

Being a Committer does not grant write permission on `develop` or `master` for security reasons (Users trust the value investing bot with their Exchange API keys).
Being a Committer does not grant write permission on `develop` or `master` for security reasons (Users trust the investing algorithm framework with their financial secrets).

### Help

After being Committer for some time, a Committer may be named Core Committer and given full repository access.
If you want help, or not sure on how to become a committer for the project, feel free to sent an email to: investing.algorithm.framework@gmail.com
6 changes: 0 additions & 6 deletions INSTALL

This file was deleted.

39 changes: 39 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Installation


### Install Python
Being a Python framework, it requires Python. Python includes a lightweight database called
SQLite that the framework can use so you won’t need to set up a database just yet.

As of now, the framework only works with python 3.x.

### Python pip install (recommended)

You can easily use pip to install the framework in your python environment.

```sh
$ pip install investing-algorithm-framework
```

### Installation from source

First clone the repository
```sh
$ git clone https://github.com/investing-algorithms/investing-algorithm-framework.git
```

Then install the framework by running:
```sh
$ pip install <path to cloned investing-algorithm-framework>
```

### Verifying the installation

To verify that you correctly installed the framework, type python from your shell. Then at the Python prompt,
try to import investing-algorithm-framework:

```python
import investing-algorithm-framework
print(investing-algorithm-framework.get_version())
```

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
graft investing_bot_framework
graft investing_algorithm_framework
include AUTHORS
include INSTALL
include LICENSE
91 changes: 21 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,48 @@

# Investing Algorithm Framework

The Investing Algorithm Framework is a free and open source Python framework that encourages rapid development and clean,
pragmatic design.
The Investing Algorithm Framework is a python framework to build investment algorithms. It encourages rapid development and clean,
pragmatic design. It is free for personal usage and open source.

The goal is to give you a configurable investing algorithm where you can decide how you implement your data providers,
strategies, and order executors.
In most cases, you'll probably never have to change code on this repo directly if you are building your algorithm/bot. But if you do, check out CONTRIBUTING.md

#####Disclaimer
If you use this framework for your investments, do not risk money which you are afraid to lose. We can't stress this
enough:
If you'd like to chat with investing-algorithm-framework users and developers, [join us on Slack](https://inv-algo-framework.slack.com)

BEFORE YOU START USING MONEY WITH THE FRAMEWORK, MAKE SURE THAT YOU TESTED YOUR COMPONENTS THOROUGHLY. USE THE SOFTWARE AT
#### Disclaimer
If you use this framework for your investments, do not risk money which you are afraid to lose. We can't stress this
enough:

BEFORE YOU START USING MONEY WITH THE FRAMEWORK, MAKE SURE THAT YOU TESTED YOUR COMPONENTS THOROUGHLY. USE THE SOFTWARE AT
YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR INVESTMENT RESULTS.

Also, make sure that you read the source code of any plugin you use or implementation of an algorithm made with this
Also, make sure that you read the source code of any plugin you use or implementation of an algorithm made with this
framework.

Documentation
------
All documentation is in the "docs" directory and online at "". If you're just getting started, here's how we recommend
you read the docs:

* First, read install for instructions on installing Investing Algorithm Framework.
* Next, work through the tutorials in order. ("Quickstart", "Template algorithm", "Custom algorithm").
* For concrete algorithm examples you probably want to read through the topical guides.


## Development branches

The project is currently setup in two main branches:

- `develop` - This branch has often new features, but might also cause breaking changes.
- `master` - This branch contains the latest stable release. The bot 'should' be stable on this branch, and is generally well tested.
- `feature/*` - These are feature branches, which are being worked on heavily. Please don't use these unless you want to test a specific feature.
- `hotfix/*` - These are hot fix branches, which are being worked on heavily. Please don't use these unless you really need to.

## Documentation
All documentation can be found online at "".

### Help / Slack

For any questions not covered by the documentation or for further
information about the bot, we encourage you to join our slack channel.
information about the framework, we encourage you to join our slack channel.

[Slack](https://join.slack.com/t/investingbots/shared_invite/enQtODgwNTg3MzA2MjYyLTdiZjczZDRlNWJjNDdmYThiMGE0MzFhOTg4Y2E0NzQ2OTgxYjA1NzU3ZWJiY2JhOTE1ZGJlZGFiNDU3OTAzMDg)
[join us on Slack](https://inv-algo-framework.slack.com)

### [Bugs / Issues](https://github.com/investingbots/value-investing-bot/issues?q=is%3Aissue)

If you discover a bug in the bot, please
[search our issue tracker](https://github.com/investingbots/value-investing-bot/issues?q=is%3Aissue)
[search our issue tracker](https://github.com/investing-algorithms/investing-algorithm-framework/issues?q=is%3Aissue)
first. If it hasn't been reported, please
[create a new issue](https://github.com/investingbots/value-investing-bot/issues/new) and
ensure you follow the template guide so that our team can assist you as
quickly as possible.

### [Feature Requests](https://github.com/investingbots/value-investing-bot/labels/enhancement)

Have you a great idea to improve the bot you want to share? Please,
first search if this feature was not [already discussed](https://github.com/investingbots/value-investing-bot/labels/enhancement).
If it hasn't been requested, please
[create a new request](https://github.com/investingbots/value-investing-bot/new)
and ensure you follow the template guide so that it does not get lost
in the bug reports.

### [Pull Requests](https://github.com/investingbots/value-investing-bot/pulls)
[create a new issue](https://github.com/investing-algorithms/investing-algorithm-framework/issues/new) and
ensure you follow the template guide so that developers can assist you as quickly as possible.

Feel like our bot is missing a feature? We welcome your pull requests!
Feel like the framework is missing a feature? We welcome your pull requests!

Please read our
[Contributing document](https://github.com/investingbots/value-investing-bot/blob/develop/CONTRIBUTING.md)
[Contributing document](https://github.com/investing-algorithms/investing-algorithm-framework/blob/master/CONTRIBUTING.md)
to understand the requirements before sending your pull-requests.

**Note** before starting any major new feature work, *please open an issue describing what you are planning to do* or talk to us on [Slack](https://join.slack.com/t/investingbots/shared_invite/enQtODgwNTg3MzA2MjYyLTdiZjczZDRlNWJjNDdmYThiMGE0MzFhOTg4Y2E0NzQ2OTgxYjA1NzU3ZWJiY2JhOTE1ZGJlZGFiNDU3OTAzMDg).
**Note** before starting any major new feature work, *please open an issue describing what you are planning to do* or talk to us on [Slack](https://join.slack.com/t/investingbots/shared_invite/enQtODgwNTg3MzA2MjYyLTdiZjczZDRlNWJjNDdmYThiMGE0MzFhOTg4Y2E0NzQ2OTgxYjA1NzU3ZWJiY2JhOTE1ZGJlZGFiNDU3OTAzMDg).
This will ensure that interested parties can give valuable feedback on the feature, and let others know that you are working on it.

**Important:** Always create your PR against the `develop` branch, not `master`.

## Requirements

### Uptodate clock
The clock must be accurate, syncronized to a NTP server very frequently to avoid problems with communication to the exchanges.

### Min hardware required

To run this bot we recommend you a cloud instance with a minimum of:

- Minimal (advised) system requirements: 2GB RAM, 1GB disk space, 2vCPU

In the future raspberry pi support will be added.

### Software requirements

- [Python 3.6.x](http://docs.python-guide.org/en/latest/starting/installation/)
- [pip](https://pip.pypa.io/en/stable/installing/)
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [virtualenv](https://virtualenv.pypa.io/en/stable/installation/) (Recommended)
- [Docker](https://www.docker.com/products/docker) (Recommended)
**Important:** Always create your feature or hotfix against the `develop` branch, not `master`.
2 changes: 1 addition & 1 deletion ci/test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

python3 -m unittest discover -s ../
pytest ../.
2 changes: 1 addition & 1 deletion investing_algorithm_framework/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from investing_algorithm_framework.utils.version import get_version

VERSION = (1, 0, 0, 'alpha', 0)
VERSION = (0, 1, 0, 'alpha', 0)

13 changes: 0 additions & 13 deletions investing_algorithm_framework/tests/resources/__init__.py

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
'colorama', 'wrapt', 'requests'
],
python_requires='>=3.6',
scripts=['investing_algorithm_framework/bin/investing-algorithm-framework-admin'],
scripts=['bin/investing-algorithm-framework-admin'],
include_package_data=True,
)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from investing_algorithm_framework.tests.core.data.data_providers.resources import TestDataProviderOne, \
TestDataProviderTwo, TestObserver
from tests.core.data_providers.resources import TestDataProviderOne, TestDataProviderTwo, TestObserver


def test():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from threading import active_count
from unittest import TestCase
from time import sleep

from investing_algorithm_framework.tests.core.executors.resources import TestExecutor, TestWorkerOne, TestWorkerTwo, \
from tests.core.executors.resources import TestExecutor, TestWorkerOne, TestWorkerTwo, \
TestObserver, TestWorkerThree


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
from sqlalchemy import Column, String, Integer

from investing_algorithm_framework.tests.resources import BaseTestMixin, utils
from tests.resources import BaseTestMixin
from tests.resources import utils
from investing_algorithm_framework.core.configuration import settings
from investing_algorithm_framework.core.extensions import db

Expand Down
13 changes: 13 additions & 0 deletions tests/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os

import tests.resources.standard_settings


class BaseTestMixin:

@staticmethod
def initialize_environment():
os.environ.setdefault(
'INVESTING_BOT_FRAMEWORK_SETTINGS_MODULE', 'tests.resources.standard_settings'
)

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import random
import string


def random_string(n, spaces: bool = False):

if spaces:
Expand Down
File renamed without changes.