Skip to content

Commit

Permalink
MAINT: Updated the basic pairs algo to match lecture.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainKanuk committed Oct 13, 2016
1 parent 2d3883c commit 055a468
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lectures/pairs_trading/basic_pairs.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""
This is a basic pairs trading algorithm for use at Quantopian Workshops.
WARNING: THIS IS A LEARNING EXAMPLE ONLY. DO NOT TRY TO TRADE SOMETHING THIS SIMPLE.
https://www.quantopian.com/workshops
https://www.quantopian.com/lectures
By Delaney Granizo-Mackenzie
"""
import numpy as np
Expand All @@ -25,8 +24,8 @@ def initialize(context):
context.exit_threshold = 0.1

# Moving average lengths
context.long_ma_length = 60
context.short_ma_length = 10
context.long_ma_length = 30
context.short_ma_length = 1

# Flags to tell us if we're currently in a trade
context.currently_long_the_spread = False
Expand Down Expand Up @@ -84,4 +83,4 @@ def check_pair_status(context, data):
context.currently_short_the_spread = False
context.currently_long_the_spread = False

record('zscore', zscore)
record('zscore', zscore)

0 comments on commit 055a468

Please sign in to comment.