Strategies

Create a new strategy

  1. 1.
    On your homepage, click the plus button under "New Strategy" and give your new strategy a name.
  2. 2.
    Follow the in-app guide to choose a strategy type and an asset to trade

Swap to code-view

Swap to the "Logic" tab and then to the "Code" view to check out your new strategy's source code. You'll see an empty method that looks like this β€”
# handle new bars
def handle_new_bar(data: VelocitySlice, emit: Emit):
pass

Strategy Lifecycle

Let's discuss the strategy lifecycle. Pictured below is the lifecycle for tests β€” we will discuss live tests and live trading later in these guides.
  1. 1.
    The start a test, Pluto collects the indicators and data points the strategy requests. This collection process enables us to pre-fetch needed data for the test.
  2. 2.
    Once we know what will be needed we fetch the OHCL data and compute derivate data like indicators
  3. 3.
    Your strategy's defined handle_new_bar method is provided slices of data, one by one, but not in order.
  4. 4.
    Your strategy emits signals β€” the emitted signals are collected for processing
  5. 5.
    Signals are processed in chronological order to produce an order book, equity curve, and other test results

Run a Quicktest

The next step to developing your strategy is to run your first quicktest. In the strategy builder, you'll see a list of scenarios to run your test beside your new strategy.
  1. 1.
    Choose the scenario you want to work from
  2. 2.
    After your test is finished you'll be presented with results and an interactive chart to explore what your strategy was thinking
  3. 3.
    By default, each time you save your strategy we'll update the quicktest results.
Export as PDF
Copy link
On this page
Create a new strategy
Swap to code-view
Strategy Lifecycle
Run a Quicktest