Fwd: Quantopian Weekly Spark: Buy Low, Sell High

15 views
Skip to first unread message

Shakti D

unread,
Dec 6, 2012, 8:38:38 PM12/6/12
to talib...@googlegroups.com

Some really useful strategy to test

---------- Forwarded message ----------
From: "Dan Dunn, Quantopian" <feed...@quantopian.com>
Date: Dec 7, 2012 2:45 AM
Subject: Quantopian Weekly Spark: Buy Low, Sell High
To: "Shakti" <shak...@gmail.com>
Cc:

Welcome to Quantopian! Log in today and get ready for live trading.
Is this email not displaying correctly?
View it in your browser.
Hello Shakti,

This Week's Spark: Buy Low, Sell High

Every week, I feature an idea, a "spark" to get your creative juices flowing.  This week, the idea is so basic, so simple. . . and so complex.

The basic idea is from the Quantopian sample algorithm, but it was community member Gary Chan who re-framed the idea for us.  He took a very simple trigger - move up a few points over the moving average, or move down a few points under the moving average - and made it his own.  He altered the code to buy when the price hits the low, and to sell when it is high.  

Here is the very simplest implementation:

  if price < vwap * .97:
    order(stock, 100)
  elif price > vwap * 1.04:
    order(stock, 100)

There are so many things you can tweak:
  • What stock (or stocks) do you use?  Try other ones yourself.
  • How far above or below the average is your trigger?  You can try different triggers, and find different inflection points.
  • How long is your moving average?  A shorter moving average will be more volatile and trade more often.
Are you ready to try it yourself?  Check out Gary's Buy Low, Sell High share, click the "Clone Algorithm" button, and start hacking!

Community PostsHere are some of the interesting posts in our community this week: What do you have to share with the community this week?

As always, drop us an email at the feedback address and we'll be happy to help, respond, and listen. What features do you want next?

Thanks,

Dan Dunn

P.S. Quantopian Resources
  • See this 30-second overview of how to clone and edit algorithms easily.
  • See this longer, 4-minute video if you would rather write your first algorithm from scratch.
  • Our full documentation is online.  You can reference it from the editor in the Help link.
  • Have you read the Quantopian Manifesto? It's our vision and our goal.
  • Our backtester is open sourced. Read about Zipline.
Python Resources - Be a Better Programmer
Finance Resources - Learn More Concepts

Copyright © 2012 Quantopian, Inc.
77 Summer St, #3B
Boston, MA 02110
Reply all
Reply to author
Forward
0 new messages