Trade by Day of Month
Author: lspinv
Creation Date: 6/25/2011 6:50 PM
profile picture

lspinv

#1
I'm trying to create a simple Rules-based strategy that will buy and hold during a contiguous six day period starting at the close of the fifth to last trading day of each month and lasting through the close of the second trading day of the following month, then switch to cash until the next six day period comes around. As simple as this sounds, I cannot find such criteria in the Rules-Based Calendar Conditions. Can someone please guide me?

If this is not doable with Rules, can someone recommend an existing Code-based strategy that is similar enough that I can try to modify it (I am NOT a programmer)?

Ideally, the strategy would have a feature to allow optimization of the Buy Condition (number of days before the end-of-month) and the Sell Condition (number of days after start-of-following-month).

Thanks.
profile picture

Eugene

#2
profile picture

lspinv

#3
Thanks, Eugene. That's exactly the strategy I wanted.

However, I am getting strange results with it.

1. Using XLF from 01/20/00 thru today, in RawProfitMode, if my position size is FixedDollar=$10,000, my results are 138 Trades (59%W 41%L), NetProfit=$8,864 vs. BH NetProfit=<-$3,336>. However, if I reduce my FixedDollar amount from $10,000 to $1,000, my results are 138 Trades (37%W 63%L), NetProfit=<-$1,090> vs. BH NetProfit=<-$335>. The number of trades are the same, and the B&H is proportionately reduced by a factor of 1:10 as expected; but why are the W/L percentages (and therefore the NetProfit percentages) so different? Why would a change to the FixedDollar position amount cause such a drastic change in the W/L percentages if the trades in both scenarios are the same?

2. Furthermore, I tried using Portfolio Simulation, StartPos=$20,000, PosSize=50% (so as to equal the same $10,000 starting point), and used Margin 2:1 so as to guarantee no rejected trades. The results were 138 Trades (59%W 41%L), which conforms to the RawProfitMode $10k scenario above, but NetProfit=<$-11,144> vs. BH NetProfit=<-$13,319> If I add back the $10,000 cash that was not invested, BH NetProfit would be <-$3,319>, which is close to the above BH NetProfit in RawProfitMode w/a FixedDollar position = $10,000; but NetProfit shows <-$1,144> whereas NetProfit in RawProfitMode ($10k)was $8,864. I realize how the cumulative effect of PortfolioSimulation mode vs. RawProfit mode works, but shouldn't both modes give the same indication as to whether a strategy is good or bad?

Since the 138 Trades are consistent, this seems to indicate that the code is in fact making the correct trades in all scenarios. Why are the results so different?
profile picture

Cone

#4
It's probably the effect of fixed Commissions on smaller Position sizes. Just analyze any one trade in either scenario and find the difference (or start by turning off commissions and retesting).
profile picture

lspinv

#5
That was the problem. Thanks, Cone.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).