Systematic Trading: I sit on my bum and pontificate whilst these bad boys do all the hard work |
I DO NOT OFFER PAID FOR TRADING COURSES OR ANY OTHER SIMILAR PRODUCT. IF YOU GET AN EMAIL ALLEGEDLY FROM ME OFFERING TO SIGN YOU UP FOR ANY OF THESE IT IS FROM A FAKE ACCOUNT. PLEASE DELETE AND REPORT.
I spent 7 years working for AHL, a large systematic hedge fund (earlier in my career I also spent about 18 months trading exotic rate options for an investment bank, Barclays Capital). My first job was to develop and manage a systematic mult-asset global macro trading strategy. Subsequently I managed a multi billion dollar portfolio of fixed income strategies (futures, swaps, bonds and credit derivatives). See the 'about' page for more.
Since leaving the hedge fund industry I have written a live systematic trading system written in python and using the interactive brokers C++ API interfaced through swigiby, which I have traded my own money with since April 2014. The system trades nearly 40 futures markets with an average holding period of several weeks, and has a mainly trend following character.
I currently teach a Masters in Finance elective course on Systematic Trading Strategies at Queen Mary, University of London.
I post regular updates on my trading, answer questions and discuss different aspects of systematic trading, on this thread at elitetrader.
I have written three books on trading:
Systematic Trading, 2015
Leveraged Trading, 2019
Advanced Futures Trading Strategies, 2023
I spent 7 years working for AHL, a large systematic hedge fund (earlier in my career I also spent about 18 months trading exotic rate options for an investment bank, Barclays Capital). My first job was to develop and manage a systematic mult-asset global macro trading strategy. Subsequently I managed a multi billion dollar portfolio of fixed income strategies (futures, swaps, bonds and credit derivatives). See the 'about' page for more.
Since leaving the hedge fund industry I have written a live systematic trading system written in python and using the interactive brokers C++ API interfaced through swigiby, which I have traded my own money with since April 2014. The system trades nearly 40 futures markets with an average holding period of several weeks, and has a mainly trend following character.
I currently teach a Masters in Finance elective course on Systematic Trading Strategies at Queen Mary, University of London.
I post regular updates on my trading, answer questions and discuss different aspects of systematic trading, on this thread at elitetrader.
I have written three books on trading:
Systematic Trading, 2015
Leveraged Trading, 2019
Advanced Futures Trading Strategies, 2023
You can also get my open source python backtesting and futures trading system from github.
How much risk should we take?
Here is my best attempt at grouping my numerous blog posts on systematic trading. Some posts may be repeated under different categories.
Careers advice
So you want to be a quant trader?
Inexperienced traders
Seven deadly sins of trading
What is the right way to set stop losses
How much risk should we take?
How fast should we trade?
My own trading system
My trading system (as of December 2021)
Writing a simple execution algo
Why I don't like short end german bonds anymore
Simulating my futures system
A tale of two positions
Obligatory Brexit Post (Will I be okay?)
Obligatory Brexit ex-Post (Yes)
Building a garden trading office
Adding new instruments: Bitcoin micro futures
Trading performance: Year two
Trading performance: year three
Trading performance: year four
Trading performance: year five
Trading performance: year six
Forecast strength and risk
Kurtosis and expected returns
Trend following and skew
Testing skew and kurtosis as a trading rule
Random data: Trading the equity curve
Random data: Optimising portfolio weights the right way (TBC)
An exogenous risk overlay, take 2
Methodology
Implementing
Testing
Follow up: Adjusting portfolio weights for Sharpe Ratios
Why I don't like short end german bonds anymore
Simulating my futures system
A tale of two positions
Obligatory Brexit Post (Will I be okay?)
Obligatory Brexit ex-Post (Yes)
Building a garden trading office
Adding new instruments: Bitcoin micro futures
My own trading system: Performance
Trading performance: year oneTrading performance: Year two
Trading performance: year three
Trading performance: year four
Trading performance: year five
Trading performance: year six
Forecast strength and risk
Skew and kurtosis
Skew and expected returnsKurtosis and expected returns
Trend following and skew
Testing skew and kurtosis as a trading rule
Using random data to design trading systems
Introducing random dataRandom data: Trading the equity curve
Random data: Optimising portfolio weights the right way (TBC)
Risk management
An exogenous risk overlayAn exogenous risk overlay, take 2
Handcrafting - a heuristic robust method for portfolio construction
Motivating portfolio constructionMethodology
Implementing
Testing
Follow up: Adjusting portfolio weights for Sharpe Ratios
Follow up: A better method for dealing with correlation uncertainty
Capital correction
Reflections on QuantCon 2017
Obligatory BitCoin post
Vol targeting and trend following
Is trend following dead?
ATR vs standard deviation
Absolute or relative momentum?
Trading rules
Portfolio construction
Optimal Leverage and Kelly
Optimising my way out of a small fund (part one): an idea for dynamic optimisation (read this first)
Optimising my way out of a small fund (part five): dynamic optimisation with greedy algo (works but see modifications in next post)
Other
Why you shouldn't employ too many geniusesCapital correction
Reflections on QuantCon 2017
Obligatory BitCoin post
Vol targeting and trend following
Is trend following dead?
ATR vs standard deviation
Absolute or relative momentum?
Replicating CTA returns and the curse of dimensionality
Python code for optimisation (one period and bootstrapping), and producing different sample periods
Python code for optimising in the presence of costs with pysystemtrade
Start here
Getting historic, snapshotted prices
Getting real time streaming prices
Placing orders and receiving fills
Getting positions and accounting information
Futures rolling
Deciding positions
Execution
Accounting
Checks and balances
Estimating forecast scalars
Things I wish interactive brokers would do with their API software
Writing a simple execution algo
Using sqllite to store data
Using python to calculate your UK tax liability for trading profits
My open source python systemDocker and automated trading systems
Python code used in the book "Systematic Trading"
Python code for the trading rules in the bookPython code for optimisation (one period and bootstrapping), and producing different sample periods
Python code for optimising in the presence of costs with pysystemtrade
How to get interactive brokers native python API working
How to get python and interactive brokers API interacting via swigby 101
(Deprecated: I suggest using the native python API instead - see the above series of posts)Start here
Getting historic, snapshotted prices
Getting real time streaming prices
Placing orders and receiving fills
Getting positions and accounting information
A guide to the nuts and bolts of implementing a systematic futures trading system
Data captureFutures rolling
Deciding positions
Execution
Accounting
Checks and balances
Pysystemtrade - my open source python backtesting engine
Original motivating postEstimating forecast scalars
Instruments weights, correlations, and diversification multipliers
Optimising in the presence of costs
Developing a new trading rule - breakoutCapital correction
Docker and automated trading systems
Adding new instruments: Bitcoin micro futuresOther articles on systematic trading technology
My technology stackThings I wish interactive brokers would do with their API software
Writing a simple execution algo
Using sqllite to store data
Using python to calculate your UK tax liability for trading profits
My open source python systemDocker and automated trading systems
hi Rob, are your systems available for purchase , subscription? Thanks, Robin
ReplyDeleteNo, never. There's enough material in my book and on this website to reproduce the trading system I use, for free.
DeleteHi Rob,
ReplyDeleteHow does your framework handle the inevitable loss of power or internet connection?
E.g, maybe your framework detects a condition that requires an order to be placed but the power goes out or your internet connection goes down.
Given the description of the hardware you use to run your system it sounds like the code is NOT hosted in some datacenter but rather executes in an environment (such as your home) where such a situation can (and does) occur.
Thanks
Hi Robert, Great question. Yes I run my stuff 'at home'.
DeleteThere are a number of possible scenarios. In scenario one, I lose my internet connection, but then get it back.
Some services, eg get account value and get price will fail gracefully (treat what they get the same as a NaN).
Orders that haven't been submitted will be delayed. Given how slowly I trade, I can live with this.
More seriously if an order is submitted and I miss a fill then I'll get a break between what I think my position is, and what the broker records say. Right now I lock the position to avoid duplicate trades until I've manually fixed the problem (see http://qoppac.blogspot.co.uk/2015/07/systems-building-execution.html)
NOTE - there is room for improvement here. I plan to rewrite this process to periodically check all fills received for the day and update the database; then automatically clear any position locks.
In an extreme situation if a process fails then the cron job will restart it the next day. The only thing that won't restart is the IB API gateway.
In scenario two I lose power. The system has to be manually restarted. In the short term this is very similar to a loss of internet.
In an extreme situation (on holiday) I might lose power for a couple of weeks before being able to restart. When I restart the system will backfill all the daily prices and the required trade will then happen. Given the speed I trade at, I've tested the expected effect of this and I can live with it.
FC wrote this comment, which I accidentally deleted:
ReplyDelete"Hello! I am super excited about your stuff and that you are UK based. Do you have an opinion about these:
https://labs.ig.com/
http://docs.labs.cityindex.com/
Is the tax advantage worth the development trouble, credit risk and worse bid-ask spread? "
I don't have a problem with spread bets, but it's certainly true that if a future was available on the same terms (same tick size) I'd trade the future.
DeleteUsually that isn't the case. For example you can trade FTSE 100 at £1 a point but the future is £10. So spread bets can be especially useful if you have a smaller account, but the wider spread means you'll need to trade more slowly.
Fortunately my account is large enough that I can just stick to futures.
I discuss this problem in my book.
Excellent - I've already ordered your book. Awaiting delivery from publisher.
DeleteHi Rob,I read really great reviews about your book and was adviced by a friend to take a look into it, however, I'm a novice to trading and investing, can you advice me what to read and learn before I start reading your book?
ReplyDeleteThats a difficult question as it depends on what level you're at and which direction you want to go in. If you want to trade futures then reading Jack Schwagers books would be a good start.
DeleteHi Rob,
ReplyDeleteGreat book. I wanted to let you know that we specialize in executing systematic trading strategies for clients in the futures and commodities markets. We support several different platforms including TradeStation, TradingBlox, Mechanica, and provide access to nearly every CFTC approved product around the globe. If you know anyone that needs help with putting their strategies into the market, we can help with execution and reconciliation and do an excellent job (for over 20 years now).
Please contact me if you would like to learn more about the services we provide.
Thank you.
Shane Wisdom
www.wisdomtrading.com
Hi Rob,
ReplyDeletefirst of all, thanks for writing the book, I found it really detailed and helpful.
I've noticed a minor bug, in a summary just below Table 37, last item "Trailing stop loss when short" has a bug in math: $30 + (4 * $1.5) = $46
Thanks!
Goran
Hi Rob,
ReplyDeleteIn your book you mention how hard it is to overcome the costs in spread betting. For most EU citizens winnings on spread betting is tax free. Is that part of that calculation? Cheers
No I didn't include tax in the calculation. But spread betting is around 10 times more expensive than say trading futures. Tax would need to be insanely high on futures to make spread betting more competitive.
DeleteOk, yes that is pretty sick. When is the new book coming?
DeleteHi Rob,
ReplyDeleteHave you done any covered call writing? It seems like a good fit for a systematic trading system. Cheers
I haven't, but yes short volatility strategies like this are a good thing.
DeleteOk thanks.
DeleteHi Rob,
ReplyDeleteI came across your website while looking for someone who uses python for trading. Thankfully I found you. I would like to thank you for the informations you share with us.
I am totally interested in your book. However, I have a question about the content. Do you explain a strategy that you use to trade futures or strategies that can be employed? Because I never trade futures and I would like to start to trade by learning step by step from guidelines of your book if that is the case. What should I expect from your book?
Thanks in advance.
Hi. Yes I explain some basic strategies to trade futures (also ETF's and spread bets). But they assume some familiarity with futures already. Read something like https://www.amazon.com/Trading-Commodities-Financial-Futures-Step-/dp/0134087186/ (first four chapters)
DeleteAlso there isn't any python in the book.
Thanks Rob!
DeleteHi Rob,
ReplyDeleteafter reading your book, your blog (here) and your journal (Elitetrader) I decided to give it a try to program a system based on the framework you propose in your book. My question is about the update rate you use during live trading? Your book emphasizes to not trade too much due to the involved costs. On the other hand, from your journal I get the impression that your system runs continuously as time stamps are all around the clock. How often do you refresh/recalculate instrument parameters such as volatility, and account parameters such as volatility target? I was thinking myself to calculate account parameters once per day, preferably on a moment when all instruments are not trading (account value relatively stable). And recalculate instrument parameters once per hour (only when they are trading). Should I sample instrument parameters more often?
It depends on your holding period. Currently I probably update too much (hourly), given a holding period of a couple of weeks or more. I could easily update everything daily, and indeed in the next iteration of my code that is what I plan to do.
DeleteThank you. As my trading rules will be slow do I expect similar holding periods. A daily update rate will probably be fast enough. However, with several exchanges in multiple time zones involved does that lead to the question: "what is end of day?" Maybe I'll decide to take action at the end of the trading day of each involved exchange.
DeleteHi Rob, I think I noticed an error in your new Carry calculation worksheet (https://docs.google.com/spreadsheets/d/1ipugeBCk_W-K4_9wnQmU6RfVvZoIRzFfKrw3ly-h8QA/edit?usp=sharing). Cell G22 has: "=IF(AND(C22<>0,F22<>0,C22-F22),C22-F22,G21)". I think you should delete the third element in the "And" function.
ReplyDeleteFixed. Thanks a lot
DeleteInteresting how Excel casts into logical type.
Glad to help, thanks for all your advice in response to all my posts. I have been paper-trading your "Chapter 15" system for a few days now. Could you please confirm the following with regard to your carry strategy: On November 4th, the closing price of Dec 2016 Eurodollar was 99.075, and the closing price of Jan 2017 Eurodollar was 99.070. Therefore the trading signal would be long. So, I should be long the Jan 2017 contract, correct? What if the spread was significantly higher on the Jan 2017 contract. Would it be okay to go long the Dec 2016 contract? Would there be any reason to look at the Jan vs Feb 2017 contract, or should we always be looking at the closest two contracts in determining the forecast? Thanks.
DeleteWhich contract you should trade I discuss more here: http://qoppac.blogspot.co.uk/2015/05/systems-building-futures-rolling.html . How to measure carry I discuss more in the appendices of my book.
DeleteHi Rob, in your book you mention that is preferable to measure carry on equity futures by using the spot price. Yet, in your python system, for EUROSTX, you use the further contract (which is not held) versus the nearer contract (which, of necessity, must be held). A second question, if I may: you mention in your book that you target 37.5% annual volatility in your own futures system, but fundseeder reports your annual volatility at about 8%. Do you know why? Thanks.
ReplyDeletea) It's preferable to use spot, but I don't personally do it because of the hassle of getting sychronised data.
Deleteb) I can't remember exactly what I said in my book but I target 25%. But the fundseeder figures is lower because I have set a higher notional account value. More here https://www.elitetrader.com/et/threads/fundseeder-my-experience.298394/
Hi Rob,
ReplyDeleteI've just started live trading your chapter 15 system using you terriffic pysystemtrade code. So far, so good. In the meantime, I was interested in a recent article that described a very profitable yet simple system: If sp500 price is above 200 sma, invest it at 3x leverage; otherwise, invest in Tbills. They got a 27% CAGR, but with a max drawdown of 92%, over a very long backtest. That got me thinking about adding a stoploss feature. So, I have been backtesting a similar system with 4x leverage, but a 4% stoploss that is reset daily. I must be doing something wrong on my backtest, as I am seeing around 50% CAGR with only about a 50% max drawdown. This was backtested on the emini back to its start in 1997. I then bumped up the leverage to 10X, with a 1% stoploss, and I am seeing some crazy returns, with not unreasonable drawdowns. I am assuming a trading cost of $17 per contract. Any idea where a novice like me is going wrong? Thanks.
A few things:
Deletea) it's not unknown to find relatively simple things that deliver a high SR on a single market. You don't know if the original authors found that by luck (this was the first thing they tested) or by testing lots of variations first. In eithier case it's dangerous to assume this SR is reproducible
b) your backtest now contains futher 'implicit' fitting (trying different stoploss variations) which probably means your sharpe ratio is overstated due to overfitting
c) as a long only system your returns are overstated because past equity returns and t-bill returns are likely to much lower in future (mainly due to lower inflation)
d) because the realisable SR is probably a lot less than you think, running it with high leverage is extremely dangerous
e) these kinds of systems (stocks or T-bills) are toxic with leverage because they have low average risk, but high peak risk. A market shock when you are 100% in equities and 10 times leverage will kill you before you can get out of your position.
f) With a 1% stoploss you're going to be trading almost every day with a very short holding period. You need intraday data and you need to test the effect of delaying your fills for an hour... up to a day or even several days (think October 87 or September 2001). You also need to make sure your trading costs are spot on. What % of your account are you paying in costs annually?
A pure test of this would be to run it on lots of markets, testing different SMA variations, testing different stoplosses, and allocating amongst these variations out of sample using price history that has realistic, and being conservative with fill times. You'd get a much lower SR.
The basic idea of your system probably isn't crazy, but running it at 10x leverage IS crazy. Have another read of my book because there are many mistakes you're potentially making which I talk about at length in the book.
Thanks for your comprehensive reply, Rob. I guess my main mistake was in assuming that my stoplosses would get filled fairly quickly with an acceptable amount of slippage. I didn't realize that they could be delayed several hours or days.
DeleteLet's go back to the less outrageous system which is 4x leveraged. Let's assume another October 1987. Would my 4% stoploss be filled at close to 4%, or is that a naive assumption?
It's safest to assume you'd have been filled at the low for the day - down around 22%.
DeleteRobert, thank you for the invaluable information you collected and spent the time to share.
ReplyDeleteWhile looking at your method to retrieve account and positions info from IB, one of your two "Getting positions and accounting information" links showed as broken.
The goal was to check how your code returns from a failure/crash (Python, system...) and attempt to restore the position prior to the crash. E.g. does the code saves in a database position and account after each trade for future disaster recovery and reporting?
Thanks,
Lionel
Can you tell me which page the link is on, and the address it is trying to link to.
DeleteTo answer your question though, yes the current state is stored in databases.
Robert,
ReplyDeleteIn trading I see that intraday price volatility is more than expected by standard deviation of daily returns. I think it's because only day close prices are used. What if I get daily volatility in different way, based on returns, which are maximum price move from previous close? I.e. I use High, Low of current day and Close of previous day and I compare abs(High/Close - 1) vs abs(Low/Close - 1) to get bigger, but store its value with sign, not abs. Then EMA smoothing as usual. I've tested the method and for my instruments it shows volatility about 30% more than original method. It enables to avoid big capital moves intraday, but, I cannot understand, it decreases profits or doesn't decrease, because capital used to get positions becomes smaller...
What do you think?
Sincerely, Julia
You shouldn't expect this to increase or decrease your profits but it is true to say that adding more information (eg intra-day price movements) should give you a better forecast of volatility; so if you measure expected versus realised vol it will probably come out slightly better
DeleteHaving said that you aren't comparing apples with apples; your measure will indeed be biased compared to a daily standard deviation of returns, so you should adjust your risk target to compensate for this
Hi Rob,
ReplyDeleteWorking through the books as multiple members in my circle recommended. Would you have thoughts on a way to incorporate MAR or CALMAR instead of Sharpe? From what I’ve seen, you get penalized for upside volatility from sharpe (that is sudden portfolio size increases will hurt your sharpe). Would love to hear your ideas if you have any.
Thanks!
Depends what you mean by 'incorporate'. I can think of two places where I use Sharpe Ratios in calibrating trading systems. (i) As a performance measure when deciding what the forecast or instrument weights should be and (ii) in deciding how much leverage to use. For (ii) the Sharpe ratio is only a weak input since we're normally running with much less leverage than the Sharpe would suggest under full Kelly criteria. For (i) in principal you could use other performance measures.
DeleteI don't personally like MAR because maximum drawdown isn't a very robust statistic (drawn off just one observation) and also it's interpretation isn't very intuitive (it depends on the amount of time the strategy has been trading). CALMAR makes even less sense, since apparently it only uses the last 3 years of history.
Hi Rob,
ReplyDeletePysystemtrade calculates instrument correlations based on the past N days of returns. Might it make more sense to base the correlations on the most recent high volatility day (eg., early Feb 2018), since it's at those points in time that diversification really matters? Also, it's at those times when every instrument seems to have a correlation of close to either +1 or -1 to each other. Thanks.
You could do that but it wouldn't be correlation, it would be https://en.wikipedia.org/wiki/Tail_dependence you are measuring.
DeletePersonally I prefer to measure correlation, and then I impose a risk overlay which measures risk assuming all correlations go to 1,-1 (I'll be blogging about it soon)
Hi Rob,
ReplyDeleteIn playing with pysystemtrade, I wanted to see what happened if I removed the possibility of any short positions. I have heard that long positions usually are more effective than short positions when it comes to trend following. So, I basically added a line to your forecasting file that brought the forecast to 0 if it was negative. The result was a huge bump in sharp from .82 to .95. Do you think this is a reasonable tweak to be made to the system?
Well it completely changes what you're doing - it won't be as diversifying to a long only portfolio. Plus that isn't a statistically significant Sharpe increase.
DeleteHi Rob,
ReplyDeleteThanks for your help on my last two questions. I was looking at the carry forecast recently between LIVECOW and SOYBEAN, and I noticed that the price pattern between the two was the same, with the nearer contract being consistently greater than the further contract. This would indicate that the further contract (which I am holding) would go up in price over time. But the capped carry forecast from pysystemtrade for SOYBEAN is +20 and for LIVECOW it is -20. Do you know what could cause this? Thanks, again.
That shouldn't happen.
DeleteHi Rob, I have technical question:
ReplyDeleteWould it be possible to develop an Algo code in C, that it could connect to IB-Api? I'm aware IB-Api comes in several languages but C, the nearest is C++ which is not C.
I'd appreciate your opinion in this tricky matter.
Thanks!
Sorry for the delay in responding.
DeleteIn theory yes, but I'm not a C or C++ programmer. Try asking here https://groups.io/g/twsapi/topics
I was looking for some trading tips then i have visited your blog and found very useful tips. Please suggest some stock tips in future.
ReplyDeleteHi, Where can I purchase this one? Is this could be help about trading? I will try this guide with FxLeaders soon!
ReplyDeleteHi Rob, would it be possible for you to post the ewmac formula here, as a working example with a few days data. I have copied your formula from Appendix B, but would like to check I have it correctly. I will be using in excel and Aspen Graphics. Looking at real numbers would be a great help. Regards
ReplyDeleteFrom here
Deletehttps://www.systematicmoney.org/systematic-trading-resources
Spreadsheet: EWMAC calculation example
https://docs.google.com/spreadsheets/d/1UC6iLz5ySWDztYKhRxeTMeeGFDhIdfltXRM25P3ecWo/edit?usp=sharing
Thanks very much.
ReplyDeleteHi Rob,
ReplyDeleteI need your advice on setting up risk controls. I trade fx spot (20 times leverage for HK accounts) and just one symbol GBPJPY; fx futures and future options (CME provided leverage) for trading EUR to make most of Span margin system. Trading and risk managing manually. Returns r too good to be true 10% a month (9 pc drawdown). since fundseeder has captured it so I have to believe it.
I want to make an auto trader for Interactive Brokers for GBPJPY with lots, risk and margin management rules. How do I go about it. Manually, I estimate duration of trend and post limit orders hoping to catch climax of exhaustion. No impulsive trading. I start always with 1 standard lot and then average it if climax estimated by me does not materialises. Maximum lots used by me to average have been 5. But when retracement happens returns are quick n substantial. For auto trader I want to design lot management and stopout level and link it with drawdown or equity level. What kind of filters should I use to control drawdown and equity.
Thank you.
Hi Rob,
ReplyDeleteI need your advice on setting up lot and risk controls. I trade fx spot (20 times leverage for HK accounts) and just one symbol GBPJPY; fx futures and future options (CME provided leverage) for trading EUR to make most of Span margin system. Trading and risk managing manually. Returns are too good to be true 10% a month (9 pc drawdown). since fundseeder has captured it so I have to believe it.
I want to make an auto trader for Interactive Brokers for GBPJPY with lots, risk and margin management rules. How do I go about it. Manually, I estimate duration of trend and post limit orders hoping to catch climax of trend exhaustion taking into account the probability of daily pullbacks and daily average pips as a measuring scale . No impulsive trading. I start always with 1 standard lot and then average it if climax estimated by me does not materialises. Maximum lots used by me to average have been 5. But when retracement happens returns are quick n substantial. For an fx spot auto trader I want to design lot management and stopout level and link it with drawdown or equity level. What kind of filters should I use to control drawdown and equity.
Thank you.
Apologies for the slow response to your comment. 99% of the comments I get are spam, so inevitably when deleting them a few real comments get overlooked.
DeleteThat's an absolutely huge question you've asked (in fact really it's lots of questions), and all I can do is point you to the advice elsewhere in this blog and in my books "Leveraged Trading" and "Systematic Trading".
Hi Rob,
ReplyDeleteA bit embarrassed to ask this question.
I have been using Amibroker for designing systematic trading strategies since afl is quite easy to learn (as I belong from a commerce/management background).
Question is ...
Would your book still be helpful as you have been designing all your strategis on Python (no experience whatsoever on Python)?
Secondly - How difficult would it be for a commerce guy to get hold of python?
You can implement the strategies in the book on a spreadsheet. I have an ex-colleague who implemented them in Amibroker.
DeleteBy 'commerce' I guess you mean non programmer, and by 'get hold of' I assume you mean learn. It's hard for me to say as I have been programming for a very long time, but python is easier to learn than say C++ or Java.
Hi Rob,
ReplyDeleteIn the MA crossover rule from the starter system, should we do the calculation on :
- BID prices
- ASK prices
- the average of BID/ASK for each given day of the serie
I was planning to start with AUDUSD as a spot CFD. Thanks to your books, I have reviewed the costing section from my broker (IG) T&Cs and they will apply funding charge based on tom-next rate + an admin charge they say would be small but is not disclosed in details. Would you have any way on elaborating on this tom-next concept and how to calculate it ?
They also explain this would not happen on the corresponding CFD based on the future AUDUSD as this is included in a wider spread. So I might look at this option with a 2000Eur equity.
Looking forward to read you.
Kind Regards,
Sébastien
PS: thank you for your books - I was dreaming of an ichimoku automated scalping system (without calculating the risks) and I am now convinced the starter system is the one to follow (with a bit of JAVA)
It doesn't matter so much, but average of bid/ask is probably best.
DeleteThe 'tom-next' rate will be based on the difference in interest rates between AUD and USD two days forward, as that is when the trade settles. Problem is a 'small' admin charge has a habit of adding up over a year. I'd personally trade the CFD based on a future ('undated' in my terminology) if you have the capital.
Hi Robert,
ReplyDeleteHow to understand TURNOVER usage? I am reading book "Systematic Trading". On page 306, for stauch systems trader, there would be tradings almost every day, the TURNOVER for the system should be around 260, but on page 298, for different EWMAC rule, the TURNOVER is very small.
It is confusing me that in real trading, the TURNOVER is around 260, why do we can use specific TURNOVER for different EWMACs.
Thanks.
You need to read carefully again what the definition of turnover is. It is irrelevant whether you trade every day or not. Imagine you have an average position of 256 lots. Every day you buy or sell 1 lot. But your turnover would be once a year.
DeleteHello Rob,
ReplyDeleteThank you for your books. I have two questions regarding your system:
1. What time during the day you recommend to run the program to rebalance the positions if you trade forex (EUR/USD) using your rules? Should it be early in the morning at, say, 8.30 am, London time? And,
2. When closing positions, shall older positions be closed first or newer positions first meaning shall it be FIFO or LIFO?
If you wrote about these issues previously somewhere, would you point at them as I wasn't able to find them.
Thanks in advance,
Much appreciated,
Munkh
1. When the markets are liquid
Delete2. This question makes no sense to a futures trader
wow rob, i just notice you have a new setup! great one!
ReplyDeleteHello Rob. Quick question on Systematic Trading.
ReplyDeleteYou quite often refer to the expected risk of the portfolio (blog, ET), and for me its a bit confusing.
Is it as simple as the total of "I" (Instrument Value Volatility) in numerous tables throughout ST?
If not, are you able to refer me to a blog post / writing that talks about how you calculate Expected Risk of Portfolio?
Thanks
Just the standard formula with covariance matrix and weights.
DeleteHey Rob,
ReplyDeleteThanks so much for all your work to publish your methods. A quick question. I just installed pysystemtrade and began backtesting. You frequently say on TTU that the addition of carry to more classic trend following rules increases the sharpe at the expense of positive skew. I tested a simple combination of 6 iterations of breakouts and 6 ewmacs that you use in rob_system, and over ~70 instruments and since 1975, get a skew of only 0.036. Adding carry to the mix actually substantially increases the skew to ~0.2. What am I missing?
Thanks again
Chris
are you using daily returns? or monthly?
DeleteAh, daily. There was a well-timed discussion on this in part 2 of the holiday special of TTU. Thanks!
DeleteChris
Hi Robert, I have finished portfolio design with cash weights ( and forecasting) per Smart Portfolios. I am currently following the methodology for Asset Allocating Investor from Systematic Trading to fine tune my trading strategy for these ETFs. In [Chapter eleven example tables.xlsx] I think it is safe to add another row titled [Trade (with position inertia)] that would check if current position is between +/- 10% of Rounded target position using the formula =IF(AND(B21*1.1>=B22, B21*0.9<=B22),"No", "Yes") ( to be entered in cell B23) Cheers ~Rohit
ReplyDeleteDo what you like but I'm not changing the spreadsheet - there is already an example of implementing position inertia here https://docs.google.com/spreadsheets/d/1Q3PZ_bD_zKw2bGmshZFxHnR0hhEX4YNhjoYWhyeHWG4/edit?usp=sharing
DeleteHi Rob,
ReplyDeleteAnother question from Systematic Trading (Appendix D) where you show computation of EMA of volatility. The text uses returns (A2 - A1) / A1 and so on. But the spreadsheet in the resources is using just the differences in prices, (A2 - A1). Was it intended that way?
Thank you
Ashu
LInk to the spreadsheet please?
Deletesure and thank you ...
Deletehttps://docs.google.com/spreadsheets/d/1B-4AsflWQIdKu3CDimQw4aMNAlhVeF01LvNAenRexLs/edit#gid=1193466770
Because that's a different vol, vol of price changes not % changes, which is what is used for normalising EWMA. Reread the chapter on forecasting, chapter 7
DeleteHey Rob,
ReplyDeleteIn the Systematic Trading book, at the end of page 197 and beginning or 198 - you suggest that one should "compare your estimate of cash risk of the existing position (the ICV) to the value you had yesterday" ... By CASH RISK - do you mean the underlying 'cash instrument' (like a stock or a bond or ETF)?
Thanks
-a
"the cash risk of an existing position (the instrument currency volatility defined on page
Delete158).... " No, as it says I mean the ICV which is defined on page 158
ohh shoot ... thank you for pointing that out.
ReplyDeleteHi Robert,
ReplyDeleteI have read both Systematic Trader and Advanced Futures Trading Strategies and really appreciate both of them. Thank you for sharing your thoughts and experiences.
I mostly trade stocks and want to implement some ideas from your books into my research and trading. Currently, I am focusing on the ratio/quota between a stock and a broad index and how to adjust the ratio for risk/volatility in the share to find stocks that perform "alpha". This is where I am having some trouble; I can't figure out how to think about and calculate this properly and hope you have some good insights.
Let's assume that the standard deviation of the stock's daily returns over the past year is 1.5%, and the index has a standard deviation of 1.0%. This means the stock typically (over the past year) moves 1.5 times the index. If one day the index increases by 2.0% and the stock by 3.0%, the risk/volatility adjusted change would be 1 ((3.0%/1.5)/2.0%). In this case, the stock's outperformance is driven by higher beta/volatility/risk. I aim to buy stocks that show a risk-adjusted price change above 1 and short the stocks below 1.
This calculation is straightforward as long as both the stock and the index move in the same direction. However, I am unsure how to handle situations when they do not. For example, if the stock is up 1.2% and the index is down 0.8%, or vice versa, how should one think about and adjust for risk/volatility on those days? Should such performance be seen as positive/negative alpha? Have you looked into this or have any insights? I would greatly appreciate your thoughts on this.
Best regards,
Hugo
This sounds a lot like my relative trend system in AFTS where I normalise the returns of the index and the asset on a daily basis depending on my current vol estimate for each and then look at the cumulation of those returns.
Delete