Recording trades in TB

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Post Reply
Jason Mc
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Dec 31, 1969 7:00 pm
Location: Sydney

Recording trades in TB

Post by Jason Mc »

Hi,

When taking a system live, do people enter all their trades into TB manually via Order Generation or simply use the TB simulation as a reasonable approximation of real time?

While I imagine you could do it either way, I'd really appreciate any feedback on how others are managing this aspect of their trading.

Just thinking it through, I suppose a case could be made for monitoring both methods.

The unadjusted TB simulation would be consistent with the assumptions used in back testing. While the manually entered trades would record what was actually happening. Comparing the two set of results may help identify wayward assumptions (e.g. slippage).

I raise this question after the following exchange with Tim:
viewtopic.php?p=29791&highlight=#29791

What do others think/do?

Thanks again

Jason
DMFord
Roundtable Fellow
Roundtable Fellow
Posts: 88
Joined: Wed Jun 27, 2007 8:11 am
Location: NB, Canada

Post by DMFord »

I use the TB simulation as a reasonable approximation.

Only use order generation if fill was late/early, or to compensate for human errors in the course of trading.

You can then re-bias your equity every 1/3/6 months to correct for any drift using some of the Equity Add/Remove custom blox posted on this forum.

Dave
Jason Mc
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Dec 31, 1969 7:00 pm
Location: Sydney

Post by Jason Mc »

Hi Dave,

Thanks for taking the time to tell me how you’re handling this and for pointing me towards the Equity Add/Remove function.

In regards your comment:
Only use order generation if fill was late/early, or to compensate for human errors in the course of trading.
When I was trialing trade entry, I found that TB was recognising the amended trade via Order Generation as a second trade (and thereby messing up the trade stats).

Tim noted that: viewtopic.php?p=29791&sid=612d2145c95de ... c49de101ca
…This seems wrong, and I will look at changing this for the next 2.3 release. It seems to me that the manually entered position should take precedence for the day, and override any new entries automatically. I will investigate the options here.

If you are inputting all manually entered positions, then you can click the Ignore Test Generated Positions and the problem will be solved. The issue is only apparent when you mix and match simulation and manually entered positions…
From this, I gather that you either need to enter all of your own trades or use the TB simulation without any adjustment - mixing the two isn't accurate at this time.

I’m close to taking my first system live, but I am still not clear on how to best intergrate the TB simulation with actual trades.

At this stage, I’m thinking I’ll have three sets of records:

1) TB simulation
2) Simulation based on all trades being entered via Order Generation
3) An Excel spreadsheet with all trading details

Is this kind of what others are doing?

All feedback greatly appreciated.

Regards

Jason
Tim Arnold
Site Admin
Site Admin
Posts: 9015
Joined: Tue Apr 06, 2004 1:41 pm
Location: Boston, MA
Contact:

Post by Tim Arnold »

From this, I gather that you either need to enter all of your own trades or use the TB simulation without any adjustment - mixing the two isn't accurate at this time.
Trading Blox allows you to enter current Positions, not a historical list of Trades. So in Trading Blox it is appropriate and accurate to mix manually entered Positions and test simulation generated Positions. This tool is not designed to track all of your historical trades and associated trade statistics.
Jason Mc
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Dec 31, 1969 7:00 pm
Location: Sydney

Post by Jason Mc »

Hi Tim,

I’m a bit confused. I had the impression from one of your previous posts (see quote in my last post) that there is an issue with mixing and matching?

On a related matter, in your last post you said:
This tool is not designed to track all of your historical trades and associated trade statistics.
Having re-read the relevant section of User Manual, I now understand that Order Generation is used to tell TB what my actual positions are for the purpose of generating new orders.

From this, I presume TB is not designed to record actual stats going forward. Is this correct?

If so, this brings me back to my question about what methods people use to track their real performance. For instance, how would you deal with a situation where you missed a significant trade? This would presumably mean that your actual results would be markedly different from the simulation forevermore.

I'm thinking I would setup Excel to record actual trades and stats. Is there another method I should explore?

Any feedback on this would be greatly appreciated.

Cheers

Jason
Stephen Newton
Roundtable Knight
Roundtable Knight
Posts: 127
Joined: Wed Dec 31, 1969 7:00 pm
Location: London, England and Cape Town, South Africa

Post by Stephen Newton »

Jason this is a very interesting topic. I have been wrestling with this very problem over the past few months and here is where I have ended up (for the moment!):

1. "Live" system which runs without any adjustment to order generation apart from corrections to human error in execution (ie such as missed trades etc)
2. Using excel to keep detailed history of current and historic positions with macro automation to produce reports similar to the TB simulation runs and to compare actual trades to TB produced trades.

TB is simply a wonderful product but on my wish list is more functionality to keep actual trading in sync with the ‘live’ system. So my wish is that TB did step 2 above and for the actual trade history to inform system generated trades going forward.

We can get by using TB and Excel but I do have some trouble getting the capital to sync. You can get total equity aligned by using some of the blox posted on this forum as suggested by DMFord. However, what I find harder is getting the closed equity, open equity, system trading equity etc to sync. This is important to me as I use equity curve analysis to inform system generated trades and new capital additions.

ALL historic trades inform all of these balances. If historic trades in TB are not the result of actual trading, then these calculations must diverge. By putting current positions into TB and adjusting total capital you get half the job done I think.

I have not found the answer on this one yet and would also like to hear others thoughts. Perhaps I am just missing something and this is actually quite simple, as it seems obvious to me that most traders here would see this need and have at least debated it on this forum. The silence on this matter leads me to believe others have answers I don’t !!!
Jason Mc
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Dec 31, 1969 7:00 pm
Location: Sydney

Post by Jason Mc »

Stephen, thanks very much for the reply. It helps knowing I’m not the only one trying to figure out a reasonable way to deal with TB historical data and actual trading.

Can I encourage some of the long standing TB users to indicate if the process Stephen uses is similar to their own?

I’ve been on a steep TB learning curve for close to 12 months (despite my profile saying I’ve been around since 31 Dec 1969 – a touch before I was born actually). During this time I’ve made solid progress, thanks largely to the generous assistance of Tim, along with many past and present Forum users.

From what I can gather, Stephen’s method is the one to use. However it worries me that there will inevitably be differences between actual and TB (at least as I understand it).

Many on this Forum come across as being extremely precise in their testing. I can only imagine they require the same degree of accuracy in recording their historic trades and generating orders from that data.

I understand that TB allows you to enter current positions, but not a list of historical trades. How then, would you deal with a situation where you missed a significant historical trade? Wouldn’t this mean that your actual results would be markedly different from the simulation forevermore?

Stephen said:
... my wish is that TB did step 2 above and for the actual trade history to inform system generated trades going forward.
This is what I incorrectly thought TB did until recently.

Given the meticulous nature of many on the Forum, I’m sure the issue is my inexperience with integrating TB testing with actual trading.

I would be grateful if those who have already delt with the above issues consider pointing those of us who are unsure in the right direction.

Thanks you any assistance you can offer.

Regards

Jason
sluggo
Roundtable Knight
Roundtable Knight
Posts: 2987
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo »

Xavier has a policy: whenever he discovers that his actual position in the real market, is not identical with the theoretical Blox position, he immediately takes action to modify his actual position so it matches the theoretical position. He does this instantly. Immediately. He uses market orders to make the adjustments.

Example 1: If Xavier's Limit order to Buy 3 November Cauliflower @ 133.40 is partially filled, and he only bought 2 contracts, the instant Xavier finds out, he buys 1 more at the market price. Now his actual position is identical to the Blox theoretical position.

Example 2: If Xavier has a Stop order to sell, and that price is the Low of the session, Blox thinks he got filled. But in the real market, he didn't get filled. The instant he finds out, he sells at the market. Now his actual position is once again identical to the Blox theoretical position.

Example 3: If Xavier's Stop order to Buy is filled on Tuesday, and then on Wednesday his data vendor (CSI) "corrects a data error" which causes Blox to calculate a different Stop price for Tuesday, and this Stop price was not hit on Tuesday, the instant Xavier finds out, he sells those contracts (at market) which he bought on Tuesday. Now his actual position is once again identical to the Blox theoretical position.

Example 4: If Xavier forgets to run his Blox system one day, or forgets to place its orders (or just says, to heck with it, today I am going to take recreational drugs and ignore trading for a while), when he discovers this, he immediately places market orders that bring his actual positions into line with his theoretical positions.

Xavier believes this is a good policy, because it means he has always got the same position as Blox's theoretical position, except for a few execution errors here and there, which are corrected as soon as possible.

Xavier reasons that ALL differences of profit-and-loss between theoretical trading (in Blox) and actual trading (in his account) are merely execution problems on entry and exit. So he makes a grand simplification: he calls all of these discrepancies by the same name: SLIPPAGE.

Since Xavier tested his system with a generous allowance for slippage, he feels comfortable that the long term average cost of execution errors, is within his slippage budget used in testing.

How do you like Xavier's policy? How do you like his reasoning? It seems elegant and simple. But is it too simple? What would you do differently, and why?
Stephen Newton
Roundtable Knight
Roundtable Knight
Posts: 127
Joined: Wed Dec 31, 1969 7:00 pm
Location: London, England and Cape Town, South Africa

Post by Stephen Newton »

Sluggo some good thought provoking points as always, so lets have some fun with a metaphor.

The Art of War by Sun Tzu comes to mind (without having re-read this great work specifically for this post and therefore being reliant on memory).

Planning is absolutely core to a successful strategy of war (ie the traders design of a system according to personality, beliefs, vision, risk appetite etc…). A good plan must then be executed. Simple, unwavering execution in pursuit of the goal is fundamental. Despite meticulously planning, adjusting in the heat of battle for unforeseen events is required (which to me seems quite close to Xavier’s approach – apart from the divergence into recreational drugs!).

With TB we have the benefit of running multiple scenarios of our strategy/plan (backtesting), which builds our confidence for the coming battle. No battle ever plays out like our scenarios or exactly according to your plan, but this preparation builds the right mindset, confidence and ability to react in the heat of battle.

It seems to me in that context and as part of the planning, it would be prudent to have the best thinking and tools to help you deal with the changes that will inevitably occur. Perhaps most importantly, a plan/tool that helps you direct the battle accordingly…

TB has nailed the planning and strategy side of this equation and has started to help with directing the field of battle (ie order generation). It would be great if our ‘battle companion’ also then adjust its ‘directions’ for adjustments to the battle plan the general ultimately has to make?

This to me seems like a good desire on any general’s behalf if he/she wants to ultimately conquer the ‘enemy’?

Today we make use of other tools and techniques (in my case Excel). However as a general of my own battle, I feel that in this step I can improve (and always will!). Part of that improvement could come from better use of my battle companion's existing capability or improvements to its own capability. I would pursue both angles. I think Xavier, Jason Mc and I would all benefit from this...

I sense from your post that you are referring to the need to have a plan for how you (as the general) will react to events on the battlefield as they emerge that are not what you had planned for? Handling your emotions and confidence in this scenario being critical. I could not agree more if you are.

To me this comes from the confidence we get from planning and re-planning based on our personal experience of such unforeseen battle events. For the things we can control, we make the necessary changes to our plan going forward and for those we cannot control we rely on the confidence and understanding we get of battle that results from good planning, to guide us.

Either way TB is at the heart of my successful strategy of war. Like I seek improvement to my own behavior both in the preparation and execution of battle, I seek improvement and better use of my 'companion' too... Improvements to both feed each other's ability to ultimately conquer and win.
Jason Mc
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Dec 31, 1969 7:00 pm
Location: Sydney

Post by Jason Mc »

Sluggo, thanks for your response – which makes a lot of sense.

After reading your post and thinking over the issue, I believe my initial approach was wrong. Rather than telling TB what I have actually done, I should be aligning my positions with the simulation.

In order to “test what you trade and trade what you testâ€
Post Reply