All Projects → Doggie52 → Lean Batch Launcher

Doggie52 / Lean Batch Launcher

Licence: mit
Unofficial alternative launcher for QuantConnect's LEAN allowing for parallel execution and looping/batching with customizable parameters and ranges.

Projects that are alternatives of or similar to Lean Batch Launcher

wolfinch
Wolfinch is your friendly trader Bot written in Python
Stars: ✭ 246 (+720%)
Mutual labels:  trading-bot, trading-platform
quick trade
convenient script for trading with python.
Stars: ✭ 63 (+110%)
Mutual labels:  trading-bot, trading-platform
tradingview-alert-binance-trader
This trading bot listens to the TradingView alert emails on your inbox and executes trades on Binance based on the parameters set on the TD alerts.
Stars: ✭ 153 (+410%)
Mutual labels:  trading-bot, trading-platform
Socktrader
🚀 Websocket based trading bot for 💰cryptocurrencies 📈
Stars: ✭ 152 (+406.67%)
Mutual labels:  trading-bot, trading-platform
Cointrader
Coin Trader is a Java-based backend for algorithmically trading cryptocurrencies. It provides data collection and export, complex event processing and triggering, and backtesting - paper trading - live trading.
Stars: ✭ 332 (+1006.67%)
Mutual labels:  trading-bot, trading-platform
Krypto Trading Bot
Self-hosted crypto trading bot (automated high frequency market making) written in C++
Stars: ✭ 2,589 (+8530%)
Mutual labels:  trading-bot, trading-platform
futu algo
Futu Algorithmic Trading Solution (Python) 基於富途OpenAPI所開發量化交易程序
Stars: ✭ 143 (+376.67%)
Mutual labels:  trading-bot, trading-platform
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (+340%)
Mutual labels:  trading-bot, trading-platform
AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+656.67%)
Mutual labels:  trading-bot, trading-platform
api-version-2
Executium API Version 2 - A comprehensive trading system API which connects traders with dozens of exchanges. Currently in closed beta
Stars: ✭ 82 (+173.33%)
Mutual labels:  trading-bot, trading-platform
Gocryptotrader
A cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.
Stars: ✭ 2,214 (+7280%)
Mutual labels:  trading-bot, trading-platform
Tradinggym
Trading and Backtesting environment for training reinforcement learning agent or simple rule base algo.
Stars: ✭ 813 (+2610%)
Mutual labels:  trading-bot, trading-platform
Pythonic
Graphical Python programming for trading and automation
Stars: ✭ 131 (+336.67%)
Mutual labels:  trading-bot, trading-platform
Trading Server
A multi-asset, multi-strategy, event-driven trade execution and management platform for running many algorithms/bots at many venues simultaneously with unified risk management and reporting. Uses MongoDB for storage and Telegram for user notifications/trade consent.
Stars: ✭ 191 (+536.67%)
Mutual labels:  trading-bot, trading-platform
Roq Api
API for algorithmic and high-frequency trading
Stars: ✭ 132 (+340%)
Mutual labels:  trading-bot, trading-platform
roq-samples
How to use the Roq C++20 API for Live Cryptocurrency Algorithmic and High-Frequency Trading as well as for Back-Testing and Historical Simulation
Stars: ✭ 119 (+296.67%)
Mutual labels:  trading-bot, trading-platform
Zvt
modular quant framework.
Stars: ✭ 1,801 (+5903.33%)
Mutual labels:  trading-bot, trading-platform
Hummingbot
Hummingbot is open source software that helps you build trading bots that run on any exchange or blockchain
Stars: ✭ 4 (-86.67%)
Mutual labels:  trading-bot, trading-platform
bybit-api
Node.js connector for the Bybit APIs and WebSockets, with TypeScript & browser support.
Stars: ✭ 69 (+130%)
Mutual labels:  trading-bot, trading-platform
Lean
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
Stars: ✭ 5,675 (+18816.67%)
Mutual labels:  trading-bot, trading-platform

LEAN Batch Launcher

LEAN Batch Launcher is an unofficial, alternative launcher for QuantConnect's LEAN Engine enabling batching/looping of algorithms in parallel with different start/end dates, securities, Alphas, data resolutions and (most importantly) parameters.

Getting Started

Prerequisites

Prerequisites are the same as for LEAN.

The software has only been tested on Windows but may work fine on Linux and Mac.

Installing

  1. Make sure LEAN builds and runs properly.
  2. Clone the repository into a directory of choice. Ideally, this is not a folder inside the LEAN folder.
  3. Open LeanBatchLauncher.sln in Visual Studio and add necessary references to your pre-existing LEAN project.
    1. Trying to compile will tell you what references you need. Keep adding references in both the Algorithm, Launcher and Instance projects to LEAN's DLL files until you can compile successfully. You will need (at least) Common, Configuration, Lean.Engine, Logging, Messaging and Queues. To build the sample algorithm, you will also need Algorithm and Algorithm.Framework. The existing references (included without a HintPath) should be a guide to what's needed.
  4. Edit Instance/Program.cs lines 75 and 76 to set the correct path to and name of the algorithm to be batched. By default, the BasicTemplateFrameworkAlgorithm is referenced. Whatever DLL you choose here must be referenced in Launcher and thus compiled at runtime.
  5. Ensure Launcher/data-start-date-by-symbol.json is filled in appropriately. Each Symbol to be used in the Launcher must have its earliest start date specified.
  6. Open Launcher/batch.config.json and follow the reference guide below to configure it properly.
  7. See Algorithm/BasicTemplateFrameworkAlgorithm.cs for an example algorithm that makes use of some of the Launcher's functionality. For more examples, see Usage in algorithm sections below.
  8. Selecting the Instance project as the Startup Project and build it (F6) once.
  9. Select the Launcher project as the Startup Project and build it (F6) once to ensure files are copied appropriately.

Done! You can now run the Launcher as you please.

Configuring a batch in batch.config.json

The various options are described below. Non-optional parameters are marked as such.

Parameter Description and usage
LibraryPath Path to the root folder of the LEAN project, i.e. where the Launcher and Data folders reside. Non-optional.

Example: "LibraryPath": "C:\\Users\\John\\Algorithm\\Lib\\Lean"

Remember to use double backslashes (\\) to separate folders.
ApiJobUserId Your API job user ID. Same as in LEAN's config.json. Non-optional.

Example: "ApiJobUserId": "32476"
ApiAccessToken Your API access token. Same as in LEAN's config.json. Non-optional.

Example: "ApiAccessToken": "O8dLVxwKhXpl4JiIfHWP25eIkgs8LY3r"
ParallelProcesses How many processes your computer can handle in parallel. Must be less than or equal to the number of virtual CPU cores available. Non-optional.

Example: "ParallelProcesses": 7
StartDate The starting date of the first instance, expressed as "dd mmm yyyy" (or any other format that DateTime can parse). Non-optional.

Example: "StartDate": "01 Jan 2018"

Usage in algorithm: SetStartDate( DateTime.Parse( Config.Get( "LBL-start-date" ) ) );
Duration The length of each backtest (in months). Only integers allowed. Non-optional.

Example: "Duration": 12
AlphaModelNames An array of strings corresponding to the Name property of each Alpha you intend to run. Each Alpha you specify here must already have been created in your algorithm's main file.

Example: "AlphaModelNames": [ "Alpha1(A=3,B=2)", "Alpha1(A=1,B=4)", "Alpha2(D=6)" ]

Usage in algorithm: the Alphas intended for use must first be initialised in an IAlphaModel[] array. Then the Alpha can be selected by invoking SetAlpha( arrayOfAlphas.Where( x => x.GetModelName() == Config.Get( "LBL-alpha-model-name" ) ).Single() );
MinuteResolutions An array of integers corresponding to different minute resolutions to pass to the algorithm, one at a time.

Example: "MinuteResolutions": [ 30, 60, 120 ]

Usage in algorithm: int minuteResolution = Config.GetInt( "LBL-minute-resolution" );. You could then pass this into e.g. a consolidator.
Symbols An array of symbol strings to pass to the algorithm, one at a time.

Example: "Symbols": [ "EURUSD", "CORNUSD", "USDHKD" ]

Usage in algorithm: SetUniverseSelection( new ManualUniverseSelectionModel( QuantConnect.Symbol.Create( Config.Get( "LBL-symbol" ), SecurityType.Equity, Market.USA ) ) );
Parameters Allows you to pass in either a step or factor range:

Step range: Will step through a parameter from Start to End in fixed increments of Step. Example: "Parameters": { "LBL-band-width": { "Start": 2, "End": 5, "Step": 0.5 } }
Will yield LBL-band-width of 2, 2.5, 3, 3.5, 4, 4.5 and 5.

Usage in algorithm: var bandWidth = Config.GetDouble( "band-width" );.

Factor range: Will step through a parameter from Start to End in factors of Factor. Example: "Parameters": { "LBL-lookback-period": { "Start": 4, "End": 64, "Factor": 2 } }
Will yield LBL-lookback-period of 4, 8, 16, 32 and 64.

Usage in algorithm: var bandWidth = Config.GetInt( "lookback-period" );.

Contributing

Feel free to submit Issues and/or Pull Requests with new functionality, fixes or other enhancements.

Authors

  • Douglas Stridsberg

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].