Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 6/5/2007 Posts: 7
|
Hi,
I would like to backtest the following strategy. Please advice if possible using stock finder or not.
I have list of symbols with date. I want to open the position on that date market open and max days 2 days with 5% trailing stop.
I dont know how to do this with set of symbols, with out any technical indicators,
Thanks and Regards,
Periasamy
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You could create a RealCode Rule similar to the following:
'# EntryMonth = UserInput.Integer = 10
'# EntryDay = UserInput.Integer = 6
'# EntryYear = UserInput.Integer = 2008
If CurrentDate.Month = EntryMonth AndAlso _
CurrentDate.Day = EntryDay AndAlso _
CurrentDate.Year = EntryYear Then Pass
And Drag and Drop it into BackScanner. Adding Trade Length and Trailing Stop Trade-Based Rules would complete the BackScan. You could then run it on a Watchlist that only contained your set of symbols.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/5/2007 Posts: 7
|
Thanks Bruce for your quick response,But I have different date for different symbol, (its like few symbols for 1st october and few are 2nd Oct and so on. This is for a month atleast. for years of data, I can not create condition for every day or change the input every time, as i need to see the monthly or even yearly performance.eg. FSLR, GOOG,BIDU 10/01/2008AAPL, SPWRA 10/02/2008AA, ASML 10/04/2008...Regards,Periasamy
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I don't know of a way to input such a list into StockFinder. I think you would have to create a Rule like this manually. For example:
If CurrentDate.Year = 2008 AndAlso _
CurrentDate.Month = 10 AndAlso _
((CurrentDate.Day = 1 AndAlso _
(CurrentSymbol = "FSLR" OrElse _
CurrentSymbol = "GOOG" OrElse _
CurrentSymbol = "BIDU")) OrElse _
(CurrentDate.Day = 2 AndAlso _
(CurrentSymbol = "AAPL" OrElse _
CurrentSymbol = "SPWRA")) OrElse _
(CurrentDate.Day = 4 AndAlso _
CurrentSymbol = "ASML")) Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/5/2007 Posts: 7
|
Bruce, thanks for that. I could manage to pull out a way to read the stock symbols and date from the external file. But one more question for the timeframe.
my backtesting strategy is open at the market open (first bar of the day in 1 min timeframe) with 5% trailing stop and 15% limit and close on the next day market at close if not closed.
Is it possible to set the time frame as 1 min and period is like jan 2007?
As always, thanks in advance.
|
|
Registered User Joined: 6/5/2007 Posts: 7
|
Just a quick clarification. I understand the maximum limit of the intraday timeframe is 5000, but Is it possible to define the starting date and ending date for the timeframe instead of latest 5000 bars?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I do not know of a way to set the bars used to anything besides the most recent available data.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/1/2004 Posts: 47
|
Hi,
I want to buy at open on the last bar. I tried the following but it does not work:
- Condition: If Not islastbar Then pass
- Buy Long at Open 1 bar from now if condition is true
- Manual Start Date set one day before last bar
- Manual End Date not used
When I tried this morning, it did not work but now at 7:50 it does. Is there anything related to the time of the test? The Manual Start Date is set at 11/3/08 08:30.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
rlouis,
I don't know why the time of day would make a difference (but from your test it would appear it does), but I would have done it this way:
- Condition: If islastbar Then pass
- Buy Long at Open 0 bar from now if condition is true
- Manual Start Date set one day before last bar
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |