Coder Social home page Coder Social logo

samchaaa / avg_rotations_dash Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 2.0 84.41 MB

Avg Rotation Dash is a dashboard showing statistics of "rotations" for different financial instruments. It downloads free tick data from Dukascopy, measures rotations, then writes results to Google Sheets.

Python 100.00%
dashboard trading fx btc stocks data ticks dukascopy python google

avg_rotations_dash's Introduction

Avg Rotation Dash

Google Sheet Google Sheet - Average Rotations Dashboard LIVE

Note: As of Nov 2021, this will be scheduled to run just 1x per day to save resources.

Avg Rotation Dash is a dashboard showing statistics of "rotations" for different financial instruments. It is mainly for manual intraday and algorithmic traders.

The point of measuring rotations is to give us reasonable (but dynamic) expectations of risk.

Avg Rotation Dash downloads free tick data from Dukascopy, then resamples the ticks and measures rotations. Results are written to Google Sheets, where stats and visualizations may be further customized.

The script can run or be scheduled locally, or hosted in the cloud (using services such as PythonAnywhere, GCP, or AWS).

Hacker Noon article

YouTube video

The idea of measuring rotations originally came from FT71 (FuturesTrader71):

Vimeo - Harmonic Rotations

The code for downloading ticks from Dukascopy came originally from these repos:

terukusu / download-tick-from-dukascopy

giuse88 / duka

Also thanks to:

Make a README

Ultraworking - Work Marathon

Installation

  1. "File" > "Make a copy" of this Google Sheet

  2. Download and unzip this repo to where you'll run it (local, PythonAnywhere, AWS, et cetera).

  3. Run pip install gspread

  4. Get service account credentials for Google Sheets:

  5. In the main repo folder, open settings.py to adjust your settings (explained below).

Settings

In settings.py:

SHEET_ID (required): Id of the Google Sheet you copied. Looks like "1Ur7CJJu-cDkhcFjEXG4smsxlKYc_323PcPYloLEvshA".

DATE_RANGE (default 5): Number of business days to download data. Days outside of this will be deleted (to manage storage).

INTERVAL (default '5Min'): Ticks will be resampled to this time period. Accepts rules such as "1Min", "1H", or anything from pandas.DataFrame.resample. Higher timeframes will give you higher level swings, but less data points.

ROTATIONS_AVG (default 20): Periods for moving average over rotation results. Displays in the Sheet as a chart, and a single number (average of last 20 rotations).

INSTS (default GBPUSD, USA500IDXUSD, BTCUSD): This is a multi-line string, just add somewhere in the string and the script will parse it. Uses names from Dukascopy, without the "." or "/"'s.

Usage

Run locally:

python run_all.py

Schedule in PythonAnywhere:

python3.6 /home/samcha/avg-rot-dash/run_all.py

Troubleshooting

If you are having issues, it may be due to the script not handling scaling for every single instrument that exists. This happens converting the ticks from binary (in download_dukas.py). If you're downloading an obscure instrument, edit normalize_tick() to handle it.

Scaling also occurs for *JPY and other fx instruments, in rotations.py. Again, if you're looking at obscure instruments you may handle scaling in this file.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

avg_rotations_dash's People

Contributors

samchaaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.