[![TravisCI](https://travis-ci.org/finance/SRzone Detector.svg?branch=master)](https://travis-ci.org/finance/SRzone Detector)
[![Coverage Status](https://coveralls.io/repos/finance/SRzone Detector/badge.png)](https://coveralls.io/finance/SRzone Detector)
This program detects evidence for support & resistance (sr) zones in historical [forex] data. It's a project of the reddit r/algotrading community. It's intended purpose is to facilitate backtesting of strategies: either to exploit S&R zones, or to avoid trading near them.
My first publicly released Python code and my first Github submission. I am obviously not a Python coder. Please be gentle.
The program is written to use the Dukascopy download CSV format. Since it's Python it can be easily modified to use any other format, all it needs is date (or date/time depending on the timeframe of SR zones you want to create) and closing price.
Usage suggestion: If testing a strategy to trade S&R zones, use 'conservative' parameters to produce a smaller list of high probability zones. I.e., higher values of min_ht and min_touches and narrow zones. If testing a strategy to avoid trading in S&R zones, use 'aggressive' parameters to produce a larger list of zones.
- Navigate over to https://github.com/leecallen35/find-SRs, and fork this repo to your own account.
- Register a new GitHub Account and go through their new user workflows.
- Fill in the relevant information in the
config.json
file in the root folder and add your client id and secret as the environment variablesUBER_CLIENT_ID
andUBER_CLIENT_SECRET
. - For detailed qustions on Dukascopy data visit
https://www.dukascopy.com/wiki/en/development/strategy-api/practices/get-data-from-csv
, Runexport UBER_CLIENT_ID="
{your client id}"&&export UBER_CLIENT_SECRET="
{your client secret}"
- Run
pip install -r requirements.txt
to install dependencies - Run
python find-SRs.py
- Navigate to http://localhost:7000 in your browser
- Install the dependencies with
make bootstrap
, orpython3 pip -n install requirements.txt
, or? - Run the command
make test
, orpython3 manage.py runserver
, or ... - Run with the provided EURCAD test file as input.
- Optional parameters
--pair EUR/CAD
--fromdate 01/01/2010
--todate 1/11/2022
--period 250
--min_ht 0.02
--zone_width 0.0075
--min_touches 4
- It should produce a file matching the attached SR_EURCAD_daily.pickle
date: 2022-12-30 1.33937 1.3474 1.3486 1.3504 1.3513 1.353 1.37764
date: 2023-01-01 1.33937 1.3472 1.3484 1.3504 1.3513 1.353 1.37764
date: 2023-01-02 1.33937 1.3472 1.3484 1.3504 1.3513 1.353 1.37764
(This represents a "feature" that should probably be eliminated: I ran it using historical data ending in 2022-07-29, so it really shouldn't calculate SR zones for 2023-01-02)
- Suggestions on how to install or conditional issues you choose to cover.
If you want to work on this application we’d love your pull requests and tickets on GitHub!
- If you open up a ticket, please make sure it describes the problem or feature request fully.
- If you send us a pull request, make sure you add a test for what you added, and make sure the full test suite runs with
make test
.
Click the button below to set up this sample app on Heroku:
After creating your app on Heroku, you have to configure the redirect URL for your Uber OAuth app. Use a https://
{your-app-name}.herokuapp.com/submit
URL.
You will also want to configure the heroku environment variable FLASK_DEBUG=False in order to properly serve SSL traffic.
- [] Add functionality for an interface either headless or basic django server
- [] Format so this can be run inside a docker then Navigate to http://localhost:7000 in your browser etc
- [] Provide link and example of what the Dukascopy format is.
- [] Add more tests
- [] Add database selector for user preference. csv, tsv, parquet, sqlite, MySQL, PostGreSQL, Cassandra, NoSQL
- [] Add datasource connection
- [] Future API options
- [] What else should we add
- [] Please check
Future Features
section