The Strategy Development Kit

A quickstart guide to effortlessly design trading strategies

01

Basic Setup

Setup and create your very first basic trading strategy. Learn how to install the CryptoStruct Strategy SDK and get started writing your own strategies.

02

Placing Orders

Get to know the objects, functions and various callback methods that allow you and your strategy code to easily interact with the crypto exchanges.

03

Running the Strategy

Upload and monitor your first trading strategy and see it instantly in action. Configure and manage your strategies from the dedicated trading dashboard.

04

Strategy Backtesting

Find out how to backtest your strategies using pre-recorded data and our included backtesting tool. See what paths your strategy is taking and compare.

01 Basic Setup

Introduction

Hi! Welcome to the first part of this tutorial series on creating your own strategy using the CryptoStruct Strategy SDK.

In the course of this series you will learn how to program your own strategies, upload and configure them – and finally how to run them on real crypto exchanges. In the fourth video, you’ll also learn how to locally test-run any strategies you developed.

In this first tutorial we will start a new Java project and create a strategy class that will hold our entire trading logic.

Classes that want to use the Strategy SDK simply need to implement Strategy. Almost all included methods (that you’ll need to override in your code) describe some form of event that originates directly from the crypto exchange.

That means, you can write event-based code that reacts instantly to any new information, such as incoming public trades, or changes to your positions.

Other events include start, stop and error events that communicate status updates of your strategy, or the methods onHeartbeat() or onTimer() that get called every 500 ms or once a timer (set by you) runs out respectively.

Prerequisites

Steps

Download the Java file created in this video here.

Let’s move on to the next video where we’ll add the actual strategy logic to our code!

02 Placing Orders

Introduction

In the second tutorial we will pick up where we left off in the last video and finish writing the code for our first trading strategy.

Later, when we upload the strategy to the trading dashboard, we will also create a configuration file that includes basic information about the strategy (e.g. its name), but also values for all variables that we want to keep open and easy modifiable – so we don’t have to change and recompile the code all the time!

We call these variables parameters and they require the @Parameter annotation to work.

You will see how easy it is to write a simple, reactive strategy with only a few lines of code, while the SDK takes care of all the boilerplate code, leaving you with more time to perfect your strategy!

Prerequisites

Steps

Note: Remember to add the @Parameter annotation to diffToToB (not shown in video).

Download the Java file created in this video here.

Let’s move on to the next video, where we’ll upload and run our strategy!

03 Running the Strategy

Introduction

In the third tutorial we will take the finished java code of the previous two tutorials, upload it to the trading dashboard and run it.

We will also upload a configuration file (in json-format) that the server will use to execute your strategy.

The configuration file must contain at least the name of your strategy – the name you exported using @ExportStrategy(name = „…“), an instance name by which the strategy can be identified on the trading dashboard as well as values to all parameters that you have added to your code (using the @Parameter annotation).

By the way, any parameters with the annotation @Parameter(optional = true) can but need not be added to the configuration file.

Prerequisites

Steps

In the next video, I’ll show you how to run your strategy locally using our backtesting tool!

04 Strategy Backtesting

Introduction

In the fourth tutorial we will take our compiled code and run it locally against pre-compiled market data.

The backtesting tool quickly simulates days of trading data and lets you test the usefulness and risk involved with your strategy.

In this example we will use the data that you already received with your Strategy SDK package.

Prerequisites

Steps

Download the backtest configuration file created in this tutorial here!