Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Backtesting for list of stock symbols and date Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
samymarket
Posted : Monday, October 27, 2008 10:05:26 AM
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
Bruce_L
Posted : Monday, October 27, 2008 12:21:49 PM


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
samymarket
Posted : Monday, October 27, 2008 2:00:31 PM
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
Bruce_L
Posted : Monday, October 27, 2008 2:26:11 PM


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
samymarket
Posted : Tuesday, October 28, 2008 6:23:42 PM
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.
samymarket
Posted : Tuesday, October 28, 2008 6:56:26 PM
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?
Bruce_L
Posted : Wednesday, October 29, 2008 8:55:47 AM


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
rlouis
Posted : Wednesday, November 5, 2008 7:58:00 AM
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.
Bruce_L
Posted : Wednesday, November 5, 2008 11:51:17 AM


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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.