Hi Guys,
I have been back testing Simplicity Take One and have reasonable results from it. There are two issues I need help with.
First I have modified the code so that it only exits at the close of the same day as the entry. As archived, it exits under two different conditions: at the close of the same day if profitable and at the next day's open if unprofitable. The parameter Num determined when the exit signal occurs. With my changes, the strategy performs correctly on back testing but I can't seem to completely eliminate the now inoperative parameter Num without getting a compile error. How can it be written to eliminate Num?
Second, it has been pointed out to me that as written, the program will back test correctly but it can't be used for live trading because only trades made with 'bar + 1' will actually generate a trade alert (when bar equals Bar.Count - 1). As a result, the running the strategy live using daily bars will not close the open positions because they are on the same bar. If this is true, I would have to modify the strategy to intraday bars in order to generate a buy and sell on the same day using different bars. Is this correct? How would you modify the code to allow for use of intraday bars to generate an exit signal on the same day as the entry.
Finally, does the back testing in fact generate reliable data even while the strategy doesn't trade correctly live due to the above reference problem? I am appending the current code I am using at the bottom of this query.
Thanks for your help
Rich Man
Simplicity Take 1A
CODE:
Please log in to see this code.
Size:
Color:
First tip:
Click the "CODE" button and paste your code between the tags. I'll do that for you now so I can read it.
Size:
Color:
Hi,
1. For your and other posters' future reference, each published strategy (including "simplicity! take 1") has its own discussion forum. Go to Strategies and Trading > Published Strategies, notice the "Discussions" column. Hitting the "0 Topics" link to the right of "simplicity! take 1" will take you to its forum.
2. When posting code here or there, use the CODE button (right above where you type) to insert a pair of CODE tags. Paste your code in between, and it becomes nicely formatted and readable. Voila.
Size:
Color:
Thanks. Here's the code:
CODE:
Please log in to see this code.
Size:
Color:
Rich,
Here is the code with the "Num = 0" completely removed:
CODE:
Please log in to see this code.
I think that covers your first question.
I'll let Eugene or Cone answer your second question on whether the following original piece of code is valid:
CODE:
Please log in to see this code.
Mainly it was the use of 'bar' versus 'bar + 1' that was your concern. It works fine backtesting, but is it really valid because it won't generate a trading alert.
-- Tim
Size:
Color:
Rich and I both got the original strategy from the wiki site (
http://www2.wealth-lab.com/WL5Wiki/kbSystemPullback.ashx); however, I see this is now available to download directly.
I put a forum discussion under the strategy there. See discussion "SellAtClose call could cause bad behavior" under strategy "simplicity! take 1" on the Strategies and Trading tab.
Size:
Color: