Adriaan1 / autotrader-demo

A repository containing algo-trading strategies built for AutoTrader. See the website below.

Home Page:https://kieran-mackle.github.io/AutoTrader/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AutoTrader Logo

Welcome to the AutoTrader Demo Repository

This repository contains example strategies to help you get started with AutoTrader. Please note that the strategies here are for the latest release of AutoTrader.

Getting Started

Install AutoTrader

To run the strategies in this repository, you must first have AutoTrader installed. The easiest way to do so is by using pip:

pip install autotrader

Download this Repository

Clone this repository by your preffered method. If you are new to git, simply click the green 'code' button at the top right of this page and download the zip. Alternatively, click here. You can also clone the repository on the command line using:

git clone https://github.com/kieran-mackle/autotrader-demo/ 

Backtest a Strategy

After cloning this repo, you are ready to begin backtesting any of the strategies. Simply run runfile.py, after specifying the name of the strategy's configuration file (located in the config/ directory). For example, to run the MACD Crossover Trend Strategy, the runfile will look as so:

from autotrader.autotrader import AutoTrader      # Import AutoTrader

at = AutoTrader()                                 # Create AutoTrader instance
at.configure(show_plot=True, verbosity=1)         # Configure the settings of AutoTrader
at.add_strategy('macd')                           # Provide the name of the strategy configuration file
at.backtest(start = '1/1/2020',                   # Configure the backtest
            end = '1/1/2021',
            initial_balance=1000,
            leverage = 30)
at.run()                                          # Run AutoTrader

Tutorials

If you would like a detailed explanation of how to construct a strategy with AutoTrader, refer to the tutorials on the AutoTrader website, by clicking here.

Demo Strategies

The following is a list of demo strategies provided in this repository. The configuration file names of each is provided.

  • macd.yaml MACD Crossover Trend Strategy (from the website tutorials)
  • ema_crossover.yaml/long_ema_crossover.yaml EMA Crossover Strategy (long only example plus long/short Forex example)
  • supertrend.yaml SuperTrend Trend Detector (AutoScan demo)
  • MTF_ema_crossover.yaml Multiple timeframe EMA Crossover example
  • rebalance.yaml Portfolio rebalancing example

Requesting a Strategy

Have a strategy you would like to be automated? Request it here.

About

A repository containing algo-trading strategies built for AutoTrader. See the website below.

https://kieran-mackle.github.io/AutoTrader/


Languages

Language:Python 100.0%