Right, majority of my systems are mean reversion with relatively high trade count. 1048 entries YTD, across all systems. Re "multiple positions using daily bars" - it depends on what you mean. I use to use intraday data for backtesting in a past, but switched to EOD for 99% of my backtesting couple of years ago. It seems to be sufficient. And I do hold many positions at the same time. Typically anywhere from 6 to 30 across all strategies. There is prioritization between them as only one can take a position in the same symbol at the same time (for simplicity). Though, on rare occasion and depending on the exit type, I might have couple trades in the same ticker on the same day, let's say if one strategy hits a target very fast. LMT orders - I do use them at some extend. Execution is almost an art. There is a lot of little edges there. That's why I created my own software to execute, monitor, manage positions and manage risk. It is called, very creatively, a "trader". Normally runs on its' own for weeks at the time and just sends me occasional reports. I can command it via Slack for convenience. "With Amibroker it's somewhat complicated to code and backtest limit orders when you run multiple positions" - I'm not sure what you mean exactly. If you are talking about multiple strategies possibly taking positions in the same symbol at the same time - then yes, RealTest handles it very well out of the box. If that's what you are asking about of course. Check out a Documentation Marsten created, it is actually a full of nuggets coming from a real Market Wizard doing this stuff for 20+ years.. Here is how he handles Intraday Fills - https://mhptrading.com/realtest/docs/index.htm > Backtest Engine Details > Intraday Fills... In general, Marsten tried to keep things very simple in RealTest and avoided introducing any real coding at any cost. So strategies looks very declaratively. Val
To me that just means he is good. No-one suspected Madoff for decades because he was just that good. Bensdorp should at least say which hedge fund he was running, are any of the results publicly viewable? As per the article, he personally talks to the potential clients and quite aggressively seems to ask for money. I don't see any very successful business-person doing this, it's petty and not worth it.
Well, that seems to be me. First of all, I have both LB’s books. They are good books, but lets’ face it: being able to write a good book about trading doesn’t mean one is a good trader/ investor. In the ’90, for example, George Angell wrote a very good book about stock index futures (with an awful title "how to triple you money every year...."). But aside the book, he made the real money selling courses and seminars explaining some crap methods, and was at the end fined by the CFTC (same old story, speaking of hypotethical profit as if were real….) So, IMHO, Bensdorp’s books doesn’t tell anything technically wrong. IMHO, the “wrong” part lies in what it's important and he doesn’t talk about: 1) Both books have the “hypothetical disclaimer”. So he didn’t use in real trading the systems he wrote about, OR – if he tried – he got different results. That could be normal if it is just an author, BUT - according to his claims - he's not just another author, he claims - at the time of writing - trading about 50 trading systems at once (*). 2) he doesn’t declare the name of the software he’s using, Trading Blox. That’s a bit odd because he talks about his travels in Ecuador or living a luxury life seaside in Spain (which are good if one has marketing objectives, but of ZERO interest for others traders willing to read just about trading…. )….. but he’s not saying a word about his trading software. Well, I might be wrong, but I guess I know why……. Users of Trading Blox or Mechanica know it’s relatively easy to get equity curves like the ones he shows. It requires some time, but it’s very doable by anyone willing to keep trying as long as necessary. 3) Unluckily, having a suite of not correlated systems is a good thing but this is not where problems end. This is where problems begin…. because it’s not trivial to send every days hundreds of orders to your brokers (with an execution rate of maybe 2-5%), and it’s even less trivial to match real time results with hypothetical results. 4) Match hypothetical results is not just a matter of commissions and slippage. It’s also a matter of FILTER selection. There are some problems when you test on daily data, you are obliged to start the trade only on OPEN, filtering symbols based on conditions of the day before, because otherwise you don’t know what symbols intraday have triggered your orders first …. but this is obviously a gross limitation for practical purposes. 5) As I said to him privately, I guess Val’s edge is not in his systems. It’s in the technology he uses to send his orders to the markets, and – not surprisingly - he’s using his own proprietary software for this purpose. Points 3) 4) and 5) are critical for people trading like LB claims. Yet, he doesn’t say a word about them in the books …. other than he does some mentoring…..and if you liked what you just read, you can apply (givivg away a lot of personal information… before even knowing the price tag) (*) which by the way is nonsense from a statistical point of view. When you have already a good number of non correlated system, the power of "more" diversification became smaller and smaller and is not worth the effort. Furthermore, the diversification isn't mostly affected by the number of systems, but on their FUTURE correlations.
I think I'm allowed to answer this, since RealTest is not currently a commercial product. Here's a simple example of this kind of strategy, which requires CBT in AB: daily trading universe: member of Russell 3000 index price > 10 20-day average volume > 100K shares price above its 200-day average rank within above criteria by lowest RSI(2) limit price for entry: one ATR(5) below yesterday's close position size: 10% of mark-to-market account size maximum open positions: 10 maximum limit orders to place: 10 - open positions hold open positions until RSI(2) > 50 (sell at next open) Here is the complete code required in RealTest for the above strategy: Of course, repeated expressions such as "C-ATR(5)" can be pre-calculated in the Data section, named parameters can replace the repeated constants such as 10, common elements can be shared by multiple strategies, etc. You can make scripts as complex as you want, but complexity is not a requirement.
You could develop a portfolio of strategies which place all their orders before the open (as in the example I just posted, though it is obviously not an optimal strategy). No automation is required for that. You could also have the best automation engine in the world and feed it garbage signals and lose money. Val's edge is the whole package of his strategy research plus his automation. I'll add that I have my own automation engine too (different from Val's), but there's no secret sauce in it. If IB had the ability in Basket Trader to place any number of limit orders and then automatically cancel the remainder after the first X have been filled (with different sub-baskets for different strategies), then I would reqire neither their API nor real-time data.
Hi Marsten first of all, let me say it’s awesome you take the time to interact in this thread, and I want to thank you for that (sorry for my English, I'm in Europe). I could be wrong, but the strategy you posted above is a perfect example of what I’m saying. Let’s say we use daily data for back testing Your strategy ranks the stocks with the lowest RIS(2) calculated at the close of the day before. (let’s call it day -1); the lowest RSI (2), the better. It could be done only at the close in day (-1) even if your code doesn’t specify that, otherwise there should be a future leak. So on (Day -1) the strategy - A) Rank all stocks in the universe tradable by the lowest RSI(2); On (day 0), the strategy B) checks how many open position we have. We can open new position only for K stocks, K = max(10 – open position,0); C) if we have “room” to open new trades, then check if – during all trading day, with daily data ..... independently of the time stamp – some stock had a low less then ATR(5); D) rank of all the stock identified in B) according ro criteria A) , and makes K new open positions. What’s the problem in using only daily data? Well, you already understand it: we don’t know at which time of the day the eligible stocks (according to A) traded below ATR (5). So the daily simulation will never be paired by “real trades”. Without intraday data we simply don’t know which stock of the list C) triggered first. But there’s more. Let’s say our rank criteria is very good. It identifies the stocks that are more likely to mean revert and the stocks that ill do so with greater magnituide. Well, shorld that be the case, out backtest on daily data will always be better than real time trading (with LIMIT order triggered intraday). Because at the end of Day 0 the software will chose the stock most oversold the day before... effectively selecting the better stock for this given strategy So, if you want realistic backtesting and enter during the day with LIMIT order, you need intraday data. Of course, there are alternatives. Intraday data on 7000 stocks can be a bit combersome. So, one could use daily data and randomize the rank criteria, to get a feeling of a median possible outcome. But this require to be aware of the problem, not negating it. Well I take note. But we are not all the same. I’m not a programmer turned trader, so my view are a bit different. In my view, in the real life, there are far less successful multisystem multimarket automated trader than one could envisage from the backtesting ( and I’ve seen my sufficient slice of this type of backtesting, starting from the post of Mark Johnson using Trading Recipes on the “Traderclub “ forum of Chuck Le Beau) So what lies the difference? I think it's what follows the hypothetical backtesting........................... but that's just me. It's "my" truth, based only on my little experience. Others may have a different one, and may disagree. Maybe, sooner or later, someone will write a new book that will start where Bensdrop finishes..... and I will be the first interested!
I see that you have a good understanding of some of the typical pitfalls in modeling limit order entry using daily bars. However, the particular example that I posted has none of these pitfalls. Right now (Saturday morning), the most recently known complete bar is Friday's. All of the formulas in the script are therefore evaluated using Friday's close as the most recently known price. The strategy (based on running the test) currently has 2 positions open. It will therefore be allowed to place 8 limit orders on Monday before the open. It will choose those 8 symbols by ranking the universe by 1/RSI(2) and taking the top 8 (lowest RSI), again, using Friday's bar (and those before it) to calculate this ranking. It will also use Friday's bar (and those before it) to calculate the C-ATR(5) limit prices. It does not matter in what sequence these orders fill on Monday. Whichever ones touch (or exceed) their limit prices will fill, the others won't. Whichever ones fill will be the same ones that fill in a future simulation of the strategy. In other words, when this script is run in the future, and it comes along to 9/21/20 as the bar to model trades for, it will use 9/18/20 as the most recent bar to evaluate formulas with. See this section of my documentation for further details about how this works.
Above there’s (more than) an error I cannot edit anymore in the original post. Line should be read: D) rank of all the stock identified in C) according to criteria A) , and makes K new open positions. Many thanks Marsten, very straightforward. I suspect (but it’s just a guess) other software work the other way around (they first calculate the signals and then rank). The documentation is really interesting, I stumbled (meaning, I’m not reading it from start to end) also to: Intraday Fills With Daily Bars Intraday Fill Sequence Assumptions
I fell into this trap as a newbie. I spent years on that system thinking the execution is decent and why the sim doesn't match real. In retrospect it's of course utter stupidity beyond belief. As I understood @mhparker is sending orders only up to what the equity allows. So they're only cancelled if limit is not hit. And you're talking about sending a large number of limit orders, assuming that only some are filled and rest get terminated for lack of buying power.
The former is what my simple example script does. The purpose of that example was to answer the question that is quoted in that post. It does not represent how I actually trade. The latter is closer to how Val and I both trade (in some strategies). Though not necessarily "for lack of buying power", more like "up to a predetermined position count limit based on risk/reward assessment." And always with full understanding and acceptance of the randomness included in that approach. (By "full understanding", I mean I also have full-market tick data and am able to compare actual fill sequence to a range of randomized daily bar fill sequence assumptions and have concluded that the median of this sample is a reasonable approximation of likely outcome, therefore tick-data-level testing is not necessary.)