Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
Bruce,
In SF I am trying to backtest a simple concept of buying at the Open on a Gap up and selling at the Close the same day.
For some reason I just can't get SF to sell at the close of the same day
For ex
Buy at the Open
If Price.Open is > Price.High(1) + ATR.Value Then Pass
and sell at the Close of the same day
How do I do this?
My goal is to try to get a idea of what % of the Gaps continue to trade higher throughout the day and close higher than open, and what % reverse and close down
thanks
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
BackScanner can't make more than one trade during the bar. So if you want to do this, you would need to use an intraday time frame.
One of the available Library Conditions is called End of Day and should be usable to exit the trade on the last intraday bar of the trading day.
You can try using a daily ATR based condition to enter the trade. It may or may not work correctly. Mixing time frames in BackScanner works with some types of conditions and not others.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
One of the available Library Conditions is called End of Day and should be usable to exit the trade on the last intraday bar of the trading day.
In order for the above to work do i have to be on an Intraday time frame?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If you want to enter and exit on the same trading day, you would need to be on an intraday time frame because can't have more than one trade on the same bar in BackScanner.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
Bruce
Pls take a look at the chart I just shared in V4 under Gap Test
I have the chart on a 1 Hour time frame
I have plotted Price with diff time frame as an indicator and thats set to 1 Day
I then plotted the ATR on the Price with 1 Day time frame indicator so that the ATR is being plotted using the Daily price rather then hourly which is the main time frame on the chart.
I then created a Buy condition using the Price with the 1 Day time frame dragged in the rule with its ATR
and the End of Day condition you mentioned above as a sell condition
In the backscanner I have the Buy set to Buy at Open 0 Bars from now and the End of Day as Sell at the Close 0 Bars from now
As you can see when you look at the trades and we can use AAPL's 8/2 Gap as an example It buys at the open of 8/2 but it doesn't sell until close of 8/3
Where am I going wrong here
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I suspect the entry condition is returning true for the entire trading day. Please try putting the exit rule above the entry rule in BackScanner.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
I did
When i do that it returns no trades
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
And the time frame on both the charts and in BackScanner is set to 1 hour not streaming (you only shared the chart, not the layout)?
I am getting trades.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
Oh I see
Had no idea the backscanner has its own timeframe
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It usually doesn't matter. Mine inherited the 1 hour time frame when I added the end of day exit condition to BackScanner.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
Bruce
As I am checking the trades i see some that the 4:00 close on the hourly time frame is diff than the close on the daily time frame
For ex on the chart I shared look at ANET on 8/4 Gap up. When you turn the cursor on so that it shows the value of the indicators in the box you can see that the close on the hourly chart at 4:00 is 172.69 while the close on the daily is 172.05
Why is this
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Some settling occurs after the close, but data after 4 pm doesn't get picked up on the intraday charts.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
I see
thx
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
How do i know how far back of a intraday data I have downloaded
and whats the max I have have
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The base maximum in StockFinder is 5000 bars and can be adjusted under Settings | Data Manager.
I am going to make the assumption based on your question that you have added or know how to add a Parameter: Length Limit Block to a Block Diagram to bypass this 5000 bar limit?
If so, you can just set the length limit for that Block to something extremely high to see how back your downloaded data actually goes.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
I am familiar with that but I almost never use intraday data so I have no idea how far back it is downloaded in my computer.
when I set the data to 5000 the intraday chart on the hourly only goes back to early June does that mean that's all I have
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
No, it doesn't mean it is all you have. It probably just means you have hit the 5000 bar base limit.
Are you familiar with Block Diagrams at all? Have you tried adding the Parameter: Length Limit Block? This would allow you to bypass the 5000 bar limit.
It looks like this might not work well in SF4 based on our past exchanges (and it won't work for BackScanner even in SF5).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
I am on an hourly chart which means 7 bars per day so even with 5000 bars I should have almost 3 years of data
5000 / 7 = 714
714 / 252 = 2.8 years
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You should have data going back to the last time it was re-installed (well a few months before the last time it was re-installed).
So if you installed it years ago, you should have years of intraday data available. If you had to re-install the program or data for some reason, you would have data back to a few months before you had to re-install.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 3/31/2006 Posts: 3,207
|
How do i check the install date
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I don't know if there is a way to find this out from your installation (other than how far back the data goes). Please contact technical support. If you had to re-install the software or data, there would probably be a record.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |