Ideas for New Tick Auto Trading and Back Testing Platform
Posted: Tue May 27, 2008 7:24 pm
Folks,
I am making progress on building a home grown trading platform that I plan to share.
In this thread, would you like to discuss your ideal qualities of a automated trading platform? Note, this means ZERO discretionary trading features.
After starting this out only for personal use, I realized it may benefit others and I may benefit from the interchange of ideas.
So far, these are the requirements/features of this platform under construction. Can you think of any other important ones?
1.1 It must back test in an environment that exactly replicates a live trading environment as much as possible. To do that, it must do the following.
1.1.1 The platform must base all back testing and live trading on tick data directly.
1.1.2 It must build period bars (minute, hour, etc) progressively with each tick just like a live system.
2.1 It must operate with a large history of tick data very efficiently.
3.1 The system must have a base framework with core functionality and offer a separate very simple method of adding custom indicators, rules, and strategies.
4.1 It must handle back testing and live trading of multiple strategies in a portfolio across multiple equities/brokers.
4.1.1 So it must be able to simultaneously run different strategies.
5.1 And it must allow simple separation between the following parts of trading:
5.1.1 Separate trading rules a.k.a strategy.
5.1.2 Separate indicators.
5.1.3 Separate exit handling logic.
5.1.4 Separate money management logic.
5.1.5 Separate tick filtering logic
5.1.6 Separate strategy combination/mixing logic.
5.2.1 It must be rather simple to mix and match these components (like legos). So it must be possible to switch and test different exit handling logic or money management strategy against with the same underlying instrument.
My progress so far is that I have built the "Engine and core framework" at a basic level.
This means that it has basic classes called RulesSupport (for trading rules), ExitSupport, MoneyManagementSupport, PortfolioSupport, StrategySupport , TickEngine, BarSeries, TickSeries, DataSeries, and RandomTestStrategy.
They're all extendable to make custom trading logic, exit logic, or rules.
Just like Lego building block, these classes all have the same "interface" so you can connect different ones together in any order.
That's because they all share the IStrategyAware interface which means that you can mix and match the pieces.
Think of each piece of the strategy like a "filter" that links together with others in a chain. It allows you to interconnect the pieces in any order you like.
The portfolio pieces can connect multiple other pieces simulteneously and
The way this works is that each component piece simply says whether it is long, short, or flat and the position size.
Portfolio <- MoneyManager <- ExitRules <- TradeRules
<- TradeRules
<- MoneyManager <- TradeRules
PERFORMANCE:
This was all built with the fastest performance in mind. To that end, all prices are stored as integers without a decimal point.
Right now, on a single CPU, the system take 4 seconds to load 6 years of tick data, run a simple strategy, and save the trades to a file.
So far it has no charting interface and is completely written in C#.
I just implementing fully automated regression testing to every component using NUnit.
Again, I'm building this for myself. But if there's interest, I might share. Especially if you can contribute ideas, code, or money to the project.
I work on this evenings and weekends since I work full time as a Software Architect.
Personally I plan to use the platform to run an automated system with multiple combined strategies per instrument on many instruments simultaneously and fully automated.
Each individual strategy can have it's only exit strategy or money management with position sizing, trade history and other rules.
Then any combination of strategies can have a special portfolio with rules on how to combine those strategies together whether they're simply overlaid or conditionally applies.
Again, there may also be portfolio lever money management either per instrument or globally.
My plan is to make it all work together and test simultaneously with an optimizer for trying NOT ONLY variables but even testing different combinations.
Finally my plan is to make it possible to zoom into the strategy and examine any individual components performance with charts of its history and trading decisions individually or look at all of them as a whole, etc.
This may sound ambitious. And it is.
I welcome all feedback or ideas.
Sincerely,
Wayne
I am making progress on building a home grown trading platform that I plan to share.
In this thread, would you like to discuss your ideal qualities of a automated trading platform? Note, this means ZERO discretionary trading features.
After starting this out only for personal use, I realized it may benefit others and I may benefit from the interchange of ideas.
So far, these are the requirements/features of this platform under construction. Can you think of any other important ones?
1.1 It must back test in an environment that exactly replicates a live trading environment as much as possible. To do that, it must do the following.
1.1.1 The platform must base all back testing and live trading on tick data directly.
1.1.2 It must build period bars (minute, hour, etc) progressively with each tick just like a live system.
2.1 It must operate with a large history of tick data very efficiently.
3.1 The system must have a base framework with core functionality and offer a separate very simple method of adding custom indicators, rules, and strategies.
4.1 It must handle back testing and live trading of multiple strategies in a portfolio across multiple equities/brokers.
4.1.1 So it must be able to simultaneously run different strategies.
5.1 And it must allow simple separation between the following parts of trading:
5.1.1 Separate trading rules a.k.a strategy.
5.1.2 Separate indicators.
5.1.3 Separate exit handling logic.
5.1.4 Separate money management logic.
5.1.5 Separate tick filtering logic
5.1.6 Separate strategy combination/mixing logic.
5.2.1 It must be rather simple to mix and match these components (like legos). So it must be possible to switch and test different exit handling logic or money management strategy against with the same underlying instrument.
My progress so far is that I have built the "Engine and core framework" at a basic level.
This means that it has basic classes called RulesSupport (for trading rules), ExitSupport, MoneyManagementSupport, PortfolioSupport, StrategySupport , TickEngine, BarSeries, TickSeries, DataSeries, and RandomTestStrategy.
They're all extendable to make custom trading logic, exit logic, or rules.
Just like Lego building block, these classes all have the same "interface" so you can connect different ones together in any order.
That's because they all share the IStrategyAware interface which means that you can mix and match the pieces.
Think of each piece of the strategy like a "filter" that links together with others in a chain. It allows you to interconnect the pieces in any order you like.
The portfolio pieces can connect multiple other pieces simulteneously and
The way this works is that each component piece simply says whether it is long, short, or flat and the position size.
Portfolio <- MoneyManager <- ExitRules <- TradeRules
<- TradeRules
<- MoneyManager <- TradeRules
PERFORMANCE:
This was all built with the fastest performance in mind. To that end, all prices are stored as integers without a decimal point.
Right now, on a single CPU, the system take 4 seconds to load 6 years of tick data, run a simple strategy, and save the trades to a file.
So far it has no charting interface and is completely written in C#.
I just implementing fully automated regression testing to every component using NUnit.
Again, I'm building this for myself. But if there's interest, I might share. Especially if you can contribute ideas, code, or money to the project.
I work on this evenings and weekends since I work full time as a Software Architect.
Personally I plan to use the platform to run an automated system with multiple combined strategies per instrument on many instruments simultaneously and fully automated.
Each individual strategy can have it's only exit strategy or money management with position sizing, trade history and other rules.
Then any combination of strategies can have a special portfolio with rules on how to combine those strategies together whether they're simply overlaid or conditionally applies.
Again, there may also be portfolio lever money management either per instrument or globally.
My plan is to make it all work together and test simultaneously with an optimizer for trying NOT ONLY variables but even testing different combinations.
Finally my plan is to make it possible to zoom into the strategy and examine any individual components performance with charts of its history and trading decisions individually or look at all of them as a whole, etc.
This may sound ambitious. And it is.
I welcome all feedback or ideas.
Sincerely,
Wayne