Oh no, not another python backtester...

Hi GAT, I have a couple of questions about pysystemtrade

1) for live running, can I write the optimiser generated weights to config file so that all estimation is turned off in a system dedicated for generating live trades. Optimiser can be run in a separate process say each day.

2) Am I right to say that both variables below are only used during optimization?
forecast_weight_ewma_span
instrument_weight_ewma_span

3) To get the position for trading, I should call portfolio.get_subsystem_position

Thanks a lot

1) In theory yes, but you'd need to write your own code to do it. Adding it to the package is on my (long) to do list

2) No, they are used even if you don't optimise

3) No. system.portfolio.get_actual_position()

GAT
 
Is there a simple way to run the backtest on a selected period of time, say 2014-2017 and generate metrics like sharpe ratio etc?
 
woooo, massive code drop on https://github.com/robcarver17/pysystemtrade
looking forward to playing!

Hey james,

are you running the system live? I'm currently in the process but still lack the integration to IB besides using insync API. Things like event driven for order execution, storage to a persistent DB for intraday data. Would love to discuss these topics instead of reinventing everything. I am very familar with event driven frameworks but hopefully this one will be much slower and be synchronous to simplify everything.
 
There are already many python packages where you can back test trading strategies. Some of them also include a framework for automatic execution and complete position management.

I can't give an exhaustive list but I'll pick out:

- Quantopian's zipline
- BT
- pythalesians
- pyalgotrade
There is a longer list here.


Does the world really need another one? Well, probably not, but today I've released one anyway (this explains at least partly why it's been a month since my last post, since I've spent the last month writing it).

You can find pysystemtrade on github, here. This is version 0.0.1. It provides a basic backtesting enviroment that implements the 'staunch systems trader' example in my book. And it's GPL 3 open source.

However it's my intention that this will become a fully featured back tester that will include all the optimisation and calibration techniques that I've discussed here on the blog, and in my book. It will also, eventually, include a complete end to end system that can be used for fully automated futures trading with interactive brokers.

More on my blog, in the usual place.

GAT



nice work.

i'm looking for a platform to test rules based strategies on options. from all the backtesters you listed, ¿would you know if there are any that can be used to backtest and optimize strategies on options?

i created a post on the options section, which includes two videos with really cool studies i would like to replicate, expand and modify.



by the way, the author of the studies i linked to in my post told me that he used python to analyze the data. he highly recommends learning to use python for this kind of projects.
 
Hey james,

are you running the system live? I'm currently in the process but still lack the integration to IB besides using insync API. Things like event driven for order execution, storage to a persistent DB for intraday data. Would love to discuss these topics instead of reinventing everything. I am very familar with event driven frameworks but hopefully this one will be much slower and be synchronous to simplify everything.

Hi traider, yep happy to help in any way possible. I'm generating signals algorithmically but executing manually for now. Number of contracts is small so I thought this manageable. So far so good.
 
Hey james,

are you running the system live? I'm currently in the process but still lack the integration to IB besides using insync API. Things like event driven for order execution, storage to a persistent DB for intraday data. Would love to discuss these topics instead of reinventing everything. I am very familar with event driven frameworks but hopefully this one will be much slower and be synchronous to simplify everything.

Hey, I'm not automatically executing but rather have a process which sends out an email each day with trades on. I'm only trading 10 markets so manual execution is ok. Happy to collaborate on the execution algorithm stuff but I think I would rather spend my time on research...very own researching a cash equity stratbof a slow stat arb, but progress is slow as I'm a wage slave.
 
Hey, I'm not automatically executing but rather have a process which sends out an email each day with trades on. I'm only trading 10 markets so manual execution is ok. Happy to collaborate on the execution algorithm stuff but I think I would rather spend my time on research...very own researching a cash equity stratbof a slow stat arb, but progress is slow as I'm a wage slave.
Ah yes. The wage slave dilemma. One of these days a group of us wage slaves are spontaneously going to start working on a project we are all interested in and development velocity is going to be rapid resulting in beautiful software which will result in a multi-million dollar company. That is the beginning of my "I have a dream speech" :)
 
Back
Top