Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Will pay to write me a code template

Hi,

I am interested in learning Python gradually so I can effectively write my own algos...however, in the interim, I would like to charter a knowledgable person to write me two templates. Price negotiable. I would like to start using these templates to play with a few ideas and tweak them myself from there.

-jon

4 responses

not looking to submit a tender, but curious what templates you are looking for - tonnes of stuff already been shared around here so someone might be able to point you

...

Here's a framework that accomplishes your 'Template 2'. I made a few assumptions like not holding more than one position of a stock at a time and 'price' is the last close price, etc. It's pretty well commented so you can add and change things in their approriate areas.

As Umar pointed out, there are a lot of algorithm designs in the forums here. Everyone has their own style and approach. The main reason I like (and use) this approach is that the actual trading rules are encapsulated in a single place (a string) and not spread out around the code. Changing the rules doesn't entail changing a lot of code. The buy rules are defined on line 163 and the sell rules on line 179. Any of the algorithm 'constants' can be changed in the initialize section.

First thing to note. You wanted to trade a fixed $20k per stock. Generally this isn't a good approach. One needs to manually watch the account leverage and moreover, the backtest returns and beta will be highly dependent upon starting balance. Sizing positions based upon a percent of the portfolio size fixes this and makes for a more scalable algorithm. The framework allows for both. Just set 'context.use_fixed_positions' to False and then set 'context.max_positions' to your target number of positions (20 seems to be a good number for this particular strategy).

Also note, this is a good framework to easily backtest ideas. It doesn't however handle all exceptions and ordering issues that could arise in live trading.

Let me know if this is along the lines of what you were looking for.

Dan

  • Thank you very much Dan...that was most helpful and gracious of you.