Profile Picture

Attempting to Model Trading System, backtest shows zero trades over 10 years

Posted By rvs3 4 Years Ago

Attempting to Model Trading System, backtest shows zero trades over 10...

Posted Friday October 09 2015
I recently created a donchian channel system which tests 14 futures markets. This system is based on a proven system shown to me by a friend, and when I run the backtest, there are no trades placed on any instrument. My intention is to recreate the model system and replicate its results exactly via RightEdge.

 I've gone through a number of different routes of adjusting the data, provided by CSI, and even when the system does place trades, the results are nowhere near the test I'm modeling. 

What I've done is import the data via "Import Bar and Tick Data", and direct it into a watchlist folder.

After this, I go into "Symbol Information" for each symbol I am testing and do the following:

- Adjust asset type to Future
-Asset currency to USD(all markets traded are North American and trade in USD)
-Tick Size = 0(someone from tradersplace forum directed me to do this, as the tick data would be different back in time due to adjustments)
-Contract Size - typed in by hand according to contract size given on CSI Data Platform. (Eg: Soybean Oil is 60000, Canadian Dollar is 100000, Japanese Yen is 12500000, Cotton is 50000)
-Initial Margin = 0 (someone from tradersplace forum directed me to do this, as it would be difficult to know the margin during past time periods and adjust it)
-Expiration Date = irrelevant
- Set decimal places = 5

I personally feel it has something to do with these settings, and depending on the changes made here, especially margin and contract size, the results come out very differently. I am having some trouble differentiating what is correct or incorrect when it comes to these settings, and so far nothing I have done has even come close to replicating the results of the backtest I am modeling.

I appreciate any insight someone might have on how to correct any errors and successfully replicate this model system.

Thank you
Posted Sunday October 18 2015
If the initial margin is 0, then the entry cost of a position will be (position size * contract size * current price of asset).  This is probably a lot higher than the entry cost if the margin were specified, so what may be happening is your account balance isn't high enough to open a position.

To start investigating why a system isn't behaving as expected, I'd recommend starting by adding logging to it.  If there's an error placing an order, make sure to log that, ie:

Position pos = OpenPosition(PositionType.Long /* other parameters */);
if (pos.Error != null)

Other good places to put logging are when an order is cancelled unexpectedly and when it is filled.  Then you can start understanding what the system is doing and where the behavior is starting to diverge from what you expect.

Posted Monday October 19 2015
Thanks Daniel,

I agree that putting zero margin might throw off the results quite a bit. With that being said, is it realistic to expect accurate backtesting results with back adjusted data? Margins are always changing, and some are significant over long term periods. Is there a way to set system margin settings to a flat percentage of total contract size (eg: 10% margin is $10,000 for a $100,000 contract)

I am having trouble seeing how I can expect to get accurate backtesting results on the futures markets without including margin requirements that fluctuate to a certain extent with the contract price, if it is possible to set a percentage margin, RightEdge users may be able to get a certain level of consistency and accuracy in these tests.

Posted Tuesday October 20 2015
Is there a way to set system margin settings to a flat percentage of total contract size (eg: 10% margin is $10,000 for a $100,000 contract)

You can do this at the account level in the paper broker.  Go to Tools\Configure Services, select the paper broker, click "Modify", click "Other Settings", and set the Account Margin Factor to 10.  This will apply to all symbols so if you are trading futures together with other asset types it may not be as helpful.

I'm curious, do you have historical data for the initial margin requirements for the futures you want to trade?  If so, what format is it in?

Posted Friday October 23 2015

I use CSI data, and as far as I know the margin requirements are not included in the data. 

Similar Topics

Reading This Topic

2005-2019 © RightEdge Systems