Sedelstein,
QUOTE:
Anyone here care to take a look?
I took a look, and found some interesting things.
1. Per the web site and post #1, "So we will use the 3-day RSI indicator as a trigger to alert of a potential top." - with the author suggesting the pattern signals a potential time to buy puts. I didn't realize this at first - more on that later.
So, starting with Eugene's code, I "embellished" it.
1. For the "Day X" signal, rather than a single day drop, I used the PeakBar indicator with the percentage drop as a parameter
2. I modified Eugene's IsDownDay function to compare Close rather than High and to compare to the
prior bar, not the
"Day X" bar
At this point, I "Optimized" it, running a 10-year backtest on the S&P 500 portfolio.
Result? APR=22.36%(BH 13.72%) S&P 500, 1Jan2004, 5% equity {3.1,10,49,37} - a fair amount better than buy-and-hold.
That's when I realized that it was backwards, and should be taking short, not long, positions, to simulate buying puts.
3. I changed BuyAtMarket to ShortAtMarket and SellAtMarket to CoverAtMarket and optimized again
Surprisingly(?), the results were far worse, APR barely 1%, barely able to produce a positive result.
4. Seeing this, I made one more change, adding a Boolean (SHORTING) near the top of the code so the long or short side can be tested.
Code is below. Do you think the author would be interested in this test result?
Len
CODE:
Please log in to see this code.