Finetuning with the Backtest module is nice, but if you are like me, I’m sure you have just a few notes about the exact settings and going back a few steps to continue in a different direction might prove difficult.
So I implemented the option to save as many strategies as you like.
S – type the name of your strategy and click Save
L – select the name of the strategy from the dropdown list and click Load
D – select the name of the strategy from the dropdown list and click Delete
It’s not a registered channel (yet), but if you have a question about Futures-Trader or for a support session, you will find me in the IRC #futurestrader channel on othernet during market hours and from time to time on the weekend as well.
Just type /j #futurestrader in mIRC
Does it make a difference, if you have ESignal Tickfiles or use the simple IB TWS download Option, which gives you Minutebars instead of Ticks.
Here are my settings for October 17th for the Euro
Using an ESignal Euro Tickfile (Times are Central European Summer time)
And here the same with the IB TWS Download
As expected/hoped for, the results are the same. (So my cynical assumption, that in a trade the market will first go against you to shake you out was a correct one.)
Thank’s to Phil, who questioned my results!
Scale-In trades were not calculated correctly, which led to false results.
I have added rows, which show the Win$ / Loss$ and Total$ per trade, so it’s easier to check the results you got.
I have updated FT and posted the new FT 3.33 version for IB API 8.3 and IB API 8.6
Sunseeker, I did not mean to be rude and apologize, if you understood my article in this way.
The thing is, I have been in a lot of chatrooms, where people posted live trades, my futures-trader can post live trades, but ask yourself, what does it help your trading, when I tell you, that I entered a Euro long at 1:37:28pm EST today at 1.2131 or a DAX long at 10:45:10am EST at 4989.0?
Nothing, absolutly nothing. And had I posted the trades in realtime, it would have meant zilch, nada, just another trade made by globetrader.
In my own blog, if I use it as trade-journal such an entry might make sense, if I add some comments to it like I did, when I wrote my trading journal, but the trade without further information is just that, a trade. It might be profitable, it might get stopped-out, but knowing that you made a trade will help noone. And you could be Warren Buffet and Jesse Livermore together, it still would mean nothing.
What would mean something, if you not only told people, that you have a profitable system giving you this and that entry today, but also why. How your tradesystem generated it’s tradesignal. You already said, that it is a always in the market system. That’s interesting and I would love to discuss such systems with you, especially, if they are profitable.
Other traders I asked always told me, sorry, but that’s a big secret, because if it were known to too many it would loose it’s effectiveness. If anything a widespread tradesystem generates more volume in your direction than a system known just by yourself.
But that’s beside the point I want to make.
The idea behind the two trading systems currently implemented in Futures-Trader came from reading “Zen in the markets” and Sport’s blog, where he posted day in and out about the First Bar trade.
I just asked the question, whether it is possible to prove, that statistically these systems work. And everyone already playing with the Backtest Module will agree, that using the right trademanagement parameters, you can build a very profitable automated system, use other parameters and the same system, based on the same tradesignals, fails miserably. Actually it would be a sure way to the poor house, if you invested your money in such a system.
Again: The same entries, traded one way generate a very healthy income and traded differently are the sure way to the poor house. That was really the most astonishing result I got sofar from my backtesting.
And the consequence: It’s not the entry, which is important, which decides whether you become trading elite or just sheep. It’s your trademanagement.
I have upgraded FuturesTrader to support IB API 8.61 Beta.
Now, if you update your IB API to 8.61 you no longer need an external datasource to request historical data.
Select the symbol you want historical data from, connect to IB TWS, click download and after 1 or 2min you should see the message
At the moment I can request just 1 week of data from IB, but this might change in the future.
Be aware, that IB API 8.3 and IB API 8.6 are incompatible. So if you have programs, which require IB API 8.3 you should not upgrade.
your results are fine, but of no interest to anyone here on the board, as long as you don't explain what method you use.
I could have decided to implement a Black Box system in FuturesTrader, let you all play with it for a while and then, once you are convinced, it's working in Demo, sold it as an extra subscription like Strategy-Runner is doing it.
Instead I’m telling everybody, what both of the systems in Futures-Trader do, when Tradesignals are generated and what is causing it, so you know exactly why a tradesignal was generated and might even look it up on your charts with the timestamp each trade has.
You are using an always in the market system, something I currently don’t have implemented in Futures-Trader, so it might be a worthy addition to the Backtest Module, if something like it could be added, but results alone won’t do it. And realtime tradesignals won’t either. I once was in a trading room, where the moderator called tradesignals from a Blackbox system, and it was the worst experience in my whole trading career.
In trading you need to learn to walk alone, you can’t rely on others to do the walking for you. And if their system was so good, there would be no reason at all for them to have a paid chatroom.
So please stop posting your results and explain your system in detail instead.
You found some cool settings for the Backtest Module?
Test them with live data. I added IB TWS realtime data as datafeed for the backtest module.
Getting great results on past data is just the first step of every Backtest. Testing these settings in todays market is the crucial second step. So setup the Backtest parameters, select TWS as datafeed, connect Futures-Trader to IB TWS (File/Connect) and click Run on the Backtest Module.
The Layout got streamlined a bit and I added labels, so you know what is what.
In a trade (actually applicable only while running on the Realtime datafeed) you will see a new Button labelled “Cover”, as sometimes you might want to override the system to secure some extraordinary profits. Just be aware, that the moment you use this button your results will no longer be replicable in a backtest.
The Scale-In module got a further selection, as I found it necessary to make sure that the number of open contracts was limited to a certain maximum.
So now you can specify how many contracts will be opened per strategy as a max:
Here you want to trade 1 additional contract, if the trade goes 5 ticks against you, but that’s it. If you have already 2 contracts once the trade is 5 ticks in the profit, you don’t want a third. But you want another one, if the trade never got to -5, but just started to run. The max c entry takes care of that.
In case you are already familiar with Futures-Trader and have played with the link from Ensign to Futures-Trader or ESignal to Futures-Trader, you might also run a Playback in these Chartprograms and have your tradesignals transmitted to the Futures-Trader Backtest module. The moment you select TWS as datafeed, you will have an option to select Tradesignals as Backtest System.
There still is a lot to do, but the Backtest Module already gave me invaluable information for my real trading. My statistics always told me, Chris, finetuning your entries will get you from 72% winners to 75% winners, if you are lucky. And that’s a big big IF, because finetuning aka optimization usually leads to a less profitable system, as the filters introduced will not only filter bad but good trades as well.
But working on the Exits, working on Trademanagement, that’s something totally different. I’m getting 10%–50% profits out of the possible profits on a profitable trade right now. Increasing this number to an average of 45%-50% or better will be a huge step forward. And knowing how to Scale-in or -out of a trade backed by the statistics gives a lot of confidence. Especially when you see, that using the wrong strategy will really hurt your performance and can actually be the reason for a losing system.
Here is the link to a current Sierra Euro file, so you have a bit more data to backtest on.
I really did not know, that changing so little can mean the difference between -4000$ or +10000$ for the month. I have been adding a lot of new features to the Backtest Module, as one add-On led to another. So don’t be confused, when you see a lot of new choices on the Module.
1. Native Sierra Datafiles (*.mnd) as well as ESignal Tickfiles (Playback) and (Ensign) Minute files are supported.
Just select the appropriate Datafeed.
For Sierra and Minutefiles you need to preset the contract, as these do not include contract information.
Click Ticker (The Button might show contract information instead. EG: EURz5)
Now select the Contract you want to backtest on the leftmost buttonrow.
2. You can Stop-reverse or Fade the Market on a tradesignal and you can define to take trades with the Trend only on the Time Breakout Strategy.
There you set 2 MA’s (Simple Moving Averages) and these decide what the trend is. During a backtest run the yellow boxes will show the value of the moving averages.
3. You can change the Target Settings to values you like
Use the Target Settings Box to set the values you like in Ticks
4. The Retracement Setting has been moved, as it can be applied to both the Switch and the Time Breakout system.
What this setting does is wait for a retracement after a Tradesignal has been received.
4. You can define 3 Scale-In and 3 Scale-Out levels together with an adjustment of the Stop, in case the level is hit. The Stop is calculated in Ticks from the Initial Entry Price
To add a rule to your strategy place a checkmark in the leftmost box. You can add any values you like in these boxes, so make sure it makes sense.Be aware, that Stops and P/L are set inversely.
See the first Scale-In line: It means Add 1 contract , if my trade is at a loss of 5 ticks and move the Stop to 10 ticks from my original entry price. So effectively the Add-On contract has a Stop of 5 ticks.
The Second line makes no sense, as the moment the contract would be added at a loss of 8 ticks, the Stop would be moved to 2 ticks behind the Original Entry Price, which means, your trade would be stopped immediatly.
The third line works again: Add 1 contract, if you have a profit of 10 ticks and move the Stop to 5 ticks. This secures a Breakeven Trade.
Same rule apply for the Scale-Out module.
5. Once a test is complete, you can save the results in an Excelfile.
This file currently has just the tradedata, but no Settingsdata. I intend to change that in the future to make it easier to recreate a result.
BTW: Before someone asks: Minutefiles and Sierradatafiles contain Bar information, meaning they have information about the Open, High, Low and Close of the Bar, but no individual tickinformation. So how the price moved from Open to Close, you can’t possibly know looking at a Minutebar. But this can be important! Therefore I tried to assume the worst case scenario in case the system is in a trade: If Long, the price always moves from the Open to the Low of the bar to trigger any Stops and only then the move to the High is made and from there to the Close. Vice versa on a Short.
The question, which intrigued me most was:
What happens with my profitability, if I trade an All-In, All-Out approach (as I do right now) compared to a Scale-In in a profitable trade and compared to a Scale-In into a losing trade Strategy.
Say Euro trades at 1.2060:
A: 2 Long 1.2060 Stop 1.2050 compared to
B: 1 Long 1.2060 Stop 1.2050, Add-On 1.2065, Stop for both to 1.2055 and compared to
C: 1 Long 1.2060 Stop 1.2050, Add-On 1.2055, Stop for both remains at 1.2050
I leave it to you to test it for yourself. For me the answer to this question was already worth the work invested into this module.
The results you see here are not so different from what I already got using an All-In, All-Out approach, but now I could use a 10 tick Stop instead of the 20 tick Stop, meaning the emotional roller-coaster with this trademanagement strategy isn’t as worse as it is with a 20 tick stop trademanagement strategy.
To test for yourself, just download the FuturesTrader Update from www.futures-trader.net
Thank’s for your feedback here in the blog and by mail.
I know Sierracharts is very popular and having written a conversion routine from Sierra to Ensign Playback a year ago, I decided to reuse some of the code, so the Backtest Module will support native Sierrachart.mdb files without the need to convert them to a textfile first.
As the next version will also support the real IB TWS feed and the Ensign or ESignal Playback feed (with tradesignals, in case you have them programmed in Ensign or ESignal), it will be another day or two before the next FuturesTrader version will be released.
It really seems I’m the only one seeking answers to such mundane questions, like:
To know, whether a certain Trademanagement System works, you don’t need to test your own Tradesystem. Actually it would mean a disadvantage, if you used your own tradesystem.
Why? Because the results are not comparable.
The mechanical approach I implemented in FuturesTrader on the other hand provides something like a 50% : 50% system. That’s like flipping a coin, but everytime you run it, you get the same result and would I use your parameters with the same datafile I would also get the same result as you got.
And a change in the Stop and Targetparameters can affect the results to the better or worse, so the system really is ideal to answer the questions above. Answers, which at least I don’t get from looking at my charts.
Of course, given that I have tradesignals on my Ensign-Charts and an already existing link between Ensign and Futures-Trader, I will sometime test my own tradesignals with this new Backtesting Tool. But only when I have found tradeparameters, where I know, that these are on average over the last year or even a longer period, the best parameters for the contracts I trade.
Yesterday Sport mentioned this blog in his own blog. And 3 times the visitors than usual came around to check it out. But all of you taking a look, seem to know the answers, or…you just don’t care. You don’t need to know, because for you it works already.
But statistics tell me otherwise. About 85% of all the daytraders are not profitable. And I really can’t believe, that only the 15% already winning traders are reading this blog.
So obviously you don’t care about profitability. I received not one E-Mail asking me: “Hi Chris, I mainly trade ES, Bonds or stocks, like MSFT and my minute-files look like this. Could your tool support these?”
To tell the truth, I don’t care. I want to know, because I want to know that the statistics are in my favour, that I really have an edge, when I trade. So I will continue to develop the tools which give the answers I seek.
Using Tickfiles to backtest gives very accurate results, but it is sure time-consuming due to the large number of ticks/day. I’m currently just backtesting Euro, but the ES files are 10 times bigger, meaning it takes a lot longer to process these files.
So I’m thinking about adding support for minute files to the backtesting module.
If you are interested, let me know, what formats should be supported. The files will have to be Ascii-files and if I receive no further input, I will use the Ensign format, as this is what I have easily accessible.
Yesterday was again one of those days:
Despite everything I had told myself, I remained in my trades. The market came back and I covered both trades profitable.
Had I used my mental Stops (I have only disaster stops in the market at every time) I would have been -10 on both trades and had most likely not reentered for the upswing, as I would have questioned my signal long, having had a signal in the same direction going against me just before. So it might just be my Ego telling me, “Hey Chris I was correct in the first instance, so take the trade now”.
Therefore, I asked myself, is there a way to confirm this feeling, that trading with bigger risks aka bigger Stops gives more rewards? It is something I noticed in my trading, I do it and I get beaten up from time to time, because when the bigger Stop is hit, it hurts!
Yesterday evening I found some parameters for my Backtesting module, which provided results, which let me waver in my resolution to still manage everything by myself. It was a very profitable strategy for September (other months still need to be checked, so don’t trade it right away) and therefore a great canditate to test how different Stops affect the testresults:
The basic parameters:
Take a trade in the Euro every 30min, synctime is simply midnight and trades are taken from 01:20am to 04:14pm. The range to be broken for a trade is 4 ticks up and down from the close of each 30min candle, with a 1 tick retracement to get a slightly better entry.
Stops vary from 5 ticks, 10 ticks, 15 ticks and 20 ticks.
Let the results speak for themself (click on the image to increase size):
5 tick stop, 46% winning trades, 3590$ incl commission profit
10 tick stop, 60% winning trades, 9004$ incl. commission profit
15tick stop, 64% winning trades, 10453$ profit incl commission
and the Winner is:
20 tick stop, 66% winning trades, 13570$ profit incl. commission
I did not continue the row, because I don’t like more than 20 tick stops. Especially as 20 ticks on bigger lots becomes very exhausting emotionally. On 2 contracts it’s “just” 500$, on 5 that becomes a 1.250$ loss. Think about that, before you increase size, as these max Stops happen regularily.
But regardless of these hits, the result is absolutly clear: Trading with a Stop of less than 10 ticks is not worth the risk, 20 ticks hurts more, when the stop is hit, but it happens not so often, so you need to decide what trader you are:
If you take less trades, trade with bigger Stops, you take more trades, so trade with smaller Stops. What is less and more? Well, the 30min system I tested made on average 25 trades/day. So you can see where you fit in.
What this test confirmed for me was, that my “gut” feeling of using bigger stops in my case makes sense. Still a 20 tick Stop is big, so the next question to be answered by hard statistical data is:
Is it correct, that only scaling into a winning position is a valid trading strategy, or will taking 1 lot at the signal and adding 1 at -10 ticks (assuming a 20 tick stop) increase the overall profitability.
This means adding a scale in/scale out part to my Backtest module. This is a bit more complex, so I expect it to be ready next week. I’m extremly interested, what the results will be!
In case you have no access to ESignal.
I have now released a Futures-Trader version, which is capable of writing monthly continuous Playbackfiles.
Download FT 3.29 and once started click Options/Preferences/Save Datafiles.
Now connect to IB (File/Connect) and FT will save every tick in all contracts you have setup under Options/Select Ticker
Contracts, which have a green button to the right, will be requested from IB. You will have to let FT run for as long as you wish to receive tickdata of course.
You sit there, asking yourself:
Is Globetrader now over the edge? This whole autotrading business is just nuts, it can’t work. And even if it works on past data, my own system is a lot better having a Win% : Loss% Ratio of 73% : 27%.
Actually I’m not yet turning my business over to the computer.
And I’m not yet abandoning everything I learned for the last 3 years reading my charts.
BUT: What this autotrading module gives me, and might give you, if you start using it:
It can give you optimized Trade Management Rules.
When do I exit a profitable trade.
Where do I place a Stop as chances that the trade comes back are slim, if the trade goes this far against you.
You will tell me, that the autotrading system in Futures-Trader does not match the one you trade.
Sure. But it offers you something even better. It gives you a trading system, which has reproducable results. Meaning, if you enter the same data, using the same dataset, you will get after each and every run the same results. So even if the system is sometimes not a lot better than 50% : 50% compared to flipping a coin, you will get every time the same result. And if a change of the trade management parameters changes the results to the better, this will work in your real trading as well.
Why? Because I assume that the chances of every trade are the same in the beginning.
Prices might go up or down from where you entered regardless what your indicators tell you.
I just remained in a trade, where my indicator started to tell me: Hey Chris, I’m about to shamu down, better take the -4 exit I offer you now, than remaining in the trade. Entry was 1.1993 2 bars prior to the one I marked with an <x>. But my Stop was not hit, I know for certain now, that profitable trades might wiggle 6 ticks against me on average, so an 8 tick stop is it for now. I stayed with the trade and was rewarded.
You need FuturesTrader V 3.28 or newer and an ESignal Playbackfile for the commodity you want to test. Here’s a 10 day Euro playbackfile.
Goto www.futures-trader.net and download the FT 3.28 version.
Start FT and click Windows/Trading System Design
Now you will have to select a playbackfile by clicking Select File
Then click Options/Select Ticker and make sure the contract you want to test is selected either in the left most column or in the leftmost of the 3 right columns. On the left side 1 contract can be selected, on the right side you can select upto 6 different contracts.
Now I hope you know the contract you want to test for automatic trading from long hours of watching it on screen, as your knowledge is extremly valuable in designing a profitable system.
Set a Stopvalue: I’m currently using 7 to 10 ticks on the euro. Leave the target at 0, as you will set this after your first test run and enter the number of contracts you usually trade or leave the contract number at 1, to see the results for trading 1 contract.
Set the Starttime, Stoptime and the time after which you don’t want a new trade initiated (NoSwitch time). Set the Startdate, easiest might be 01/01 to cover the whole year, so you will make sure FT will always start at the beginning of the playbackfile. The Stopdate is automatically preset to todays date.
Now select the trade system you want to test:
If you have read “Zen in the markets” you will want to start testing a Switch System:
You set a Switch-value, which tells the system, that the trend has switched from Short to Long or vice versa. In the Euro you might start with 25 ticks, but that’s really up to you.
Next you can set a retracement level. While Eddie, as far as I understand it, recommends to immediatly enter after a trend switch, I found that waiting for a retracement gives better results. I suggest using 33% to 50% max retracement levels to enter. I have set it in my system to 8 ticks, which is a reasonable retracement level after Euro made a 25 tick run from the lows or highs.
Now you need to decide, if you want to use a trailing stop, a BE+1 Stop and Stop-Reverse orders instead of simple Stoporders.
The BE+1 Stop will trigger, once the first target is taken out, the trailing Stop moves the stop to BE+1 after the 2nd target has been hit. Then it will trail 2 targets behind, so when the 4th target is hit the stop will be moved to the 2nd target. Stop-reverse will trigger a reverse order, in case your initial Stop is hit (but not if the BE+1 Stop or a trailing Stop is hit).
The targets are fixed in this version and set to 5ticks, 8t, 10t, 12t, 15t,20t,25t,30t and 50ticks.
This will be changed in a future version.
Now click Run and off you go testing your first automatic trade system.
If the results are not what you expected, start changing the parameters or try the second trade system currently implemented:
A time breakout system:
This system takes the idea of the first bar trade and expands it to taking a trade in regular intervals.
In this example I take a trade every 90min. Actually the closing price after 90min is taken and 4 ticks added and substracted (as set by the second parameter). Now a trade is taken, the moment this 8 tick range is broken to the upside or downside.
Extremly important for a success of this kind of system is the Sync time. In my case I have set it to 9:00 which seems to be a good time for trading Euro. Play with this time and you will see, that a nicely winning system can become a loser by chosing the wrong Sync-time. Same for the timeinterval. I tested Euro July data with a 60min setting, which worked real good in September and got a losing system, switching to 90min proved to be the right decision:
The system suddenly made 344 ticks or 3322$ instead of losing during this month. Of course now the next step is testing September to see how the system will perform with the new setting. If the results are comparable or better than my earlier system results using 60min, fine, I will continue using the 90min interval, but if the results are worse, I need to see, how to determine in advance, what timeinterval to use the moment I start applying the system to real data.
Once a testrun is finished you will get a lot of statistics:
Win% and Loss%, Win:Loss ratio, Win$, Loss$ and an account balance. I have used 6$ commission per roundtrip and contract. I know, that that may be to high for some commodities, but better err on the wrong side, than give you beautiful results, which can not be reproduced in real trading.
In the columns showing the results for the different targets reached, you will see a What-If scenario: If you had eg used a 20 tick target, you might have done better, than you did by using a trailing stop only. So this might be reason to enter a number in your Target Box and do the run again. During my testing I saw that a 25 tick target on the euro produced the best results with the euro, which is the reason I now have 25 plugged in.
The real eye-opener so far for me was the fact, that the Time-Breakout system seems to have a Win%:Loss% probability of 55% : 45%. Still it is making money by applying good trade management rules.
If you follow Sport’s blog, you know the first bar trade works very well.
So I thought, well, what is the first bar trade? You take a High and Low and just take the trade on the direction the breakout occurs. Sport usually uses the first 3min bar to define the High and Low and then it’s off you go.
But why just the First bar? Because then your indicators take over!
But these work only when they work, as we all know. Why not something even more basic?
Trade the breakout of the 3min bar following every 60min bar close. Tested, but no, it did not give a working tradesystem on the dataset I used. Why not take the close of the 60min bar, add a few ticks for a high, substract a few ticks for a low and trade the breakout of this so defined range around the close of the last 60min bar.
Done that et voila! 203 ticks, where I got 132 yesterday evening (226, if I used Stop-Reverse trades as well)
Now 203 ticks in 10 days, actually 8 trading days, that’s 25 ticks a day. For an automatic trading system, which knows nothing about indicators, that’s not too bad I think.
But why does it work? Well it all depends on the Sync-Time you choose. Be in sync with the big traders and you trade when they trade. You define a chop-range around the close and if a move happens, it will be shown on all the indicators as long as they are calculated on price. So breakout-systems based on price alone can work without indicators.
I’m now testing my parameters on longer timeframes than the 10 day data I used so far. And if the performance keeps up, I will take the next step and link the system to my trading module. Of course the parameters need to be different for each contract you trade, but who said there was no work to be done…
+132 instead of -44, results looking better, but for 10 days, that’s 13 ticks/day on average...Nothing to really write home about, still a start for an automatic system. Users of my homework spreadsheet might find the above sheet familiar. Yes, instead of a simple list, I have now added the homework spreadsheet layout into the backtesting module. Why? Because I did not like to do hundreds of trial runs until by chance I would finally find one, which fit the data. No, it’s a lot better to get more information from just 1 run. The system sofar tells me nothing really new: Letting my profits run gives the best results overall. But we already knew that! Just the realtime implementation is so damned difficult. I have one additional idea for the backtest module before I will release it as part of my Futures-Trader program. So stay tuned for the next update.