Testing Using Position Limits
-
- Full Member
- Posts: 12
- Joined: Fri Oct 02, 2009 1:28 pm
Testing Using Position Limits
Is there a way to assign position limits so blox does not back test at contract position sizes that could not be replicated in live trading?
If you have the Builder Edition (which lets you write your own scripts) you can write a block that resets account equity to whatever value you choose, every December 31st.
You could start the simulation with initial account equity of (let's say) $250k. Every December 31st you reset the account equity back to $250k. If there are profits, sweep them off the table. If there are losses, top up the account equity back to $250k.
This way, a 30-year-long test won't compound up to tens of billions of dollars in equity, requiring Blox to take absurdly large position sizes (impossibly huge in the real world) during the final few years of the backtest.
Then use the Global Parameters settings "Max Percent Volume to Trade" and "Minimum Futures Volume" to prevent Blox from trading when you as a human trader, would not.
Of course this will destroy the accuracy of the equity curve statistics like CAGR, Sharpe, MAR, etc; you'll need to write your own versions of those, which handle the yearly equity resets.
You could start the simulation with initial account equity of (let's say) $250k. Every December 31st you reset the account equity back to $250k. If there are profits, sweep them off the table. If there are losses, top up the account equity back to $250k.
This way, a 30-year-long test won't compound up to tens of billions of dollars in equity, requiring Blox to take absurdly large position sizes (impossibly huge in the real world) during the final few years of the backtest.
Then use the Global Parameters settings "Max Percent Volume to Trade" and "Minimum Futures Volume" to prevent Blox from trading when you as a human trader, would not.
Of course this will destroy the accuracy of the equity curve statistics like CAGR, Sharpe, MAR, etc; you'll need to write your own versions of those, which handle the yearly equity resets.
-
- Roundtable Knight
- Posts: 2038
- Joined: Wed Oct 06, 2004 10:52 am
- Location: San Marcos, CA
Another approach is to create a table of symbols along with their position size limit values that TB can load during the Before Test script execution cycle. A good module to handle this is the module doing the unit sizing of the positions being offered for market action.
With a table approach, the simulation can read the file and store the max size value into a user created property where the sizing process can consider whether the fractional adjusted size is under the max CFTC allowed size.
If there is a Risk Manager in the system where position sizes can be increased, the size testing calculation process might best be placed in a User Created Custom script so the Risk Manager can call it to see if the increase in size it is considering will be acceptable.
With a table approach, the simulation can read the file and store the max size value into a user created property where the sizing process can consider whether the fractional adjusted size is under the max CFTC allowed size.
If there is a Risk Manager in the system where position sizes can be increased, the size testing calculation process might best be placed in a User Created Custom script so the Risk Manager can call it to see if the increase in size it is considering will be acceptable.