test equity curve trading system

Hi all,
looking for some help. I am looking to test an equity curve trading system. I can sell based on a #equity rule but once I am out of the system the equity curve goes flat so there will be no trigger to re-enter the system. What I would like to do is base my reentry rule on another shadow portfolio’s equity. Does anyone know of a way to create an entry rule based on on another portfolio’s equity?
Any help is appreciated,
Brian

I’ve not tried this, but perhaps:

  • Run a version of your model without equity curve timing and export results to excel.
  • Using excel, find the inflection points in the equity curve, noting the dates of when you’d go in or out.
  • For each date, calculate (in excel) the number of bars since inception.
  • Then build up a set of buy rules to only get back when you’re in the right date range (using PortBars())

If you’ve only got a dozen or so entry points it’s probably not too bad.

Hi Darcy,
thanks for the possible work around. I was hoping that there was a way to use something like Portfolio(“Shadow”, #equity).The reason I am trying to do this is that I noticed different Portfolio’s (as part of a Book) tend to trend for long periods of time and then other Portfolio’s will do so.

Yeah, that would be nice. I work with a forex trading platform that supports “phantom” trades, which are opened and tracked virtually. You can then use the aggregate results of those trades to open or close real positions. It’s a great feature.

Perhaps another way to approximate this is with a custom series tracking the aggregate performance of a subset of your Universe. Defining the subset would be the tricky part. Maybe multiple frank statements with some of your more heavily weighted factors…

Yes that might be possible although difficult(at least for me) to get close enough to have confidence in it, but I like the way your mind works. I may make a feature request as I would think there are others that would benefit from this.

For a quick and dirty equity timer, add the following buy rule:

PortBars<20 or Close(0,#Equity) >= sma(20,0,#Equity)

The “sitting out” time is forced to be at least as long as the moving average sample length, though…

Thanks Sglinski ,
I will test that. One other work around I have found helpful is buy rule: close(0,#bench)>ema(x,0,#bench) or close(0,#equity)>ema(y,0,#equity) . This gets me out when my equity curve goes down but gets me back in when the market turns back up. You can play with x and y values depending on your system.