Event driven backtesting in Python or R - Matlab, R project and Python | futures io social day trading
futures io futures trading


Event driven backtesting in Python or R
Updated: Views / Replies:11,782 / 28
Created: by Big Mike Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Event driven backtesting in Python or R

  #21 (permalink)
Elite Member
Philadelphia + NJ/US
 
Futures Experience: Beginner
Platform: quantstrat
Favorite Futures: ETFs
 
Posts: 52 since Aug 2014
Thanks: 4 given, 39 received


ericbrown View Post
For many of the reasons you mention, I've recently been re-learning quantstrat. I still like python for most things, but for backtesting it is hard to find an engine as robust as quantstrat on the python side.

Google Nuts and Bolts of Quantstrat

Reply With Quote
The following 2 users say Thank You to IlyaKipnis for this post:
 
  #22 (permalink)
 Vendor: sentimentrader.com 
Tulsa, OK
 
Futures Experience: Advanced
Platform: Tradestation, TOS, Python
Broker/Data: IQFeed, Tradestation, TOS
Favorite Futures: ES, SPY, Options
 
ericbrown's Avatar
 
Posts: 201 since Jan 2011
Thanks: 339 given, 234 received


IlyaKipnis View Post
Google Nuts and Bolts of Quantstrat

I've been reading your series all day. Nicely done

Reply With Quote
 
  #23 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 894 since Jul 2012
Thanks: 291 given, 1,006 received


I just want to clarify that quantstrat in R is actually event driven. However it is not the same type of events as zipline, pyalgo or quantstarts "backtester" each of those engines consider 1 bar or 1 day to be the updating event. However quantstrat in R considers a new signal the updating event. This may actually make it more efficient since it does not have to re analyze or update every day where there is no activity.

Reply With Quote
The following 2 users say Thank You to treydog999 for this post:
 
  #24 (permalink)
 Vendor: sentimentrader.com 
Tulsa, OK
 
Futures Experience: Advanced
Platform: Tradestation, TOS, Python
Broker/Data: IQFeed, Tradestation, TOS
Favorite Futures: ES, SPY, Options
 
ericbrown's Avatar
 
Posts: 201 since Jan 2011
Thanks: 339 given, 234 received

Just a follow-up to my previous post RE: quantstrat vs zipline.

I've been playing around with quantstrat for a few weeks. I like it...but I don't like it (or R) enough to switch from python completely. I'll continue using it but I'm still a fan of zipline over quantstrat for now.

Reply With Quote
 
  #25 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 894 since Jul 2012
Thanks: 291 given, 1,006 received


ericbrown View Post
Just a follow-up to my previous post RE: quantstrat vs zipline.

I've been playing around with quantstrat for a few weeks. I like it...but I don't like it (or R) enough to switch from python completely. I'll continue using it but I'm still a fan of zipline over quantstrat for now.

Honestly I really want to find that python is the better option. Which is why i started researching python and zipline in depth. I just do not feel comfortable with its lack of features at this moment. However if you are able to work with futures, pairs trading, and multi currency portfolios I would be very much interested.

The real reason is python is faster even though it requires about 60% more code. However my alternative stance is to continue to use R but then re code any bottle necks or execution in C++ and use RCCP to import that. Although its similar to what python can do, take in C++ code through a package. Also I think python would make a better end to end tech stack solution than R. Which in my current situation may become a large factor. However I do not really want to write my own custom backtester to handle these types of things. If I had to write something from scratch it would probably be in C++, since that is the fastest and most battle tested language in the computer world and heavily used in finance. Fastest testing and HFT speed executions.


@ericbrown
What is the python equivalent of PerformanceAnalytics and financial instrument packages? What would you recommend as a viable entry way to python from R if i require the capabilities mentioned above?

Reply With Quote
 
  #26 (permalink)
 Vendor: sentimentrader.com 
Tulsa, OK
 
Futures Experience: Advanced
Platform: Tradestation, TOS, Python
Broker/Data: IQFeed, Tradestation, TOS
Favorite Futures: ES, SPY, Options
 
ericbrown's Avatar
 
Posts: 201 since Jan 2011
Thanks: 339 given, 234 received


treydog999 View Post
Honestly I really want to find that python is the better option. Which is why i started researching python and zipline in depth. I just do not feel comfortable with its lack of features at this moment. However if you are able to work with futures, pairs trading, and multi currency portfolios I would be very much interested.

The real reason is python is faster even though it requires about 60% more code. However my alternative stance is to continue to use R but then re code any bottle necks or execution in C++ and use RCCP to import that. Although its similar to what python can do, take in C++ code through a package. Also I think python would make a better end to end tech stack solution than R. Which in my current situation may become a large factor. However I do not really want to write my own custom backtester to handle these types of things. If I had to write something from scratch it would probably be in C++, since that is the fastest and most battle tested language in the computer world and heavily used in finance. Fastest testing and HFT speed executions.


@ericbrown
What is the python equivalent of PerformanceAnalytics and financial instrument packages? What would you recommend as a viable entry way to python from R if i require the capabilities mentioned above?

I don't know enough about PerformanceAnalytics to say that there is a python equivalent. I will, however, say that zipline has everything built into it that I need for analyzing performance of the strategies.

Regarding zipline's immaturity...I agree. There are plenty of things missing, specifically the ability to work with futures. That's the biggest issue for me but the AlephNull fork of zipline seemingly addresses the future's issues although I haven't looked at AlephNull's version in detail yet.

From my experiences, Python does offer me more value overall for end-to-end solutions. I know there are plenty of people that use R for strat building and testing and it works well but python is the platform I've built everything else on so I'm planning on staying there if possible.

Reply With Quote
The following user says Thank You to ericbrown for this post:
 
  #27 (permalink)
Elite Member
Philadelphia + NJ/US
 
Futures Experience: Beginner
Platform: quantstrat
Favorite Futures: ETFs
 
Posts: 52 since Aug 2014
Thanks: 4 given, 39 received

Python has no PerfA equivalent. Zipline I believe was developed for quantopian, and quantopian has nowhere near the basically endless analytics of blotter/PerfA.

Reply With Quote
The following user says Thank You to IlyaKipnis for this post:
 
  #28 (permalink)
Elite Member
Stockholm
 
Futures Experience: Advanced
Platform: NinjaTrader,Sierra Chart, Python
Broker/Data: IB
Favorite Futures: ES & Stocks
 
Posts: 86 since Apr 2013
Thanks: 80 given, 71 received


IlyaKipnis View Post
Google Nuts and Bolts of Quantstrat

Very good source as well!! Thank you

Reply With Quote
 
  #29 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 894 since Jul 2012
Thanks: 291 given, 1,006 received


IlyaKipnis View Post
Python has no PerfA equivalent. Zipline I believe was developed for quantopian, and quantopian has nowhere near the basically endless analytics of blotter/PerfA.

I think that's really the wall right there. Blotter is really amazing. Although its the behind the scenes work it is really what gives a lot of the underlying functionality. Python nor Matlab has anything as nearly as robust as either of those 2 packages.

To be honest the backtester of quantstrat or zipline or any other tester for that matter are basically glorified loops. Its really the underlying functionality that makes R/quantstrat using blotter/PerfA shine.

Reply With Quote
The following user says Thank You to treydog999 for this post:

Reply



futures io > > > > Event driven backtesting in Python or R

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python: Strategy backtesting baxline Matlab, R project and Python 4 October 18th, 2017 02:37 AM
Test Driven Development shansen NinjaTrader Programming 7 July 4th, 2014 07:21 PM
Test Driven Development shansen NinjaTrader 0 June 30th, 2014 07:29 AM
Python Help Wanted $ wlblount Hire a Consultant or Programmer 0 December 25th, 2013 10:14 AM
How to Trade This Headline Driven Stock Market Quick Summary News and Current Events 0 November 7th, 2011 09:00 PM


All times are GMT -4. The time now is 01:14 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-16 in 0.14 seconds with 19 queries on phoenix via your IP 54.91.38.173