Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Sell the same day Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
thnkbigr
Posted : Monday, October 09, 2017 11:45:21 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

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  

 

Bruce_L
Posted : Tuesday, October 10, 2017 9:12:17 AM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
thnkbigr
Posted : Tuesday, October 10, 2017 11:04:00 AM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

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? 

Bruce_L
Posted : Tuesday, October 10, 2017 11:10:06 AM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
thnkbigr
Posted : Tuesday, October 10, 2017 11:28:16 AM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

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 

 

 

Bruce_L
Posted : Tuesday, October 10, 2017 12:36:42 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
thnkbigr
Posted : Tuesday, October 10, 2017 12:46:44 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

I did 

When i do that it returns no trades 

Bruce_L
Posted : Tuesday, October 10, 2017 12:54:42 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
thnkbigr
Posted : Tuesday, October 10, 2017 12:58:59 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

Oh I see

Had no idea the backscanner has its own timeframe 

Bruce_L
Posted : Tuesday, October 10, 2017 1:03:02 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
thnkbigr
Posted : Tuesday, October 10, 2017 1:19:18 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

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 

Bruce_L
Posted : Tuesday, October 10, 2017 1:25:41 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
thnkbigr
Posted : Tuesday, October 10, 2017 1:32:02 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

I see 

thx

thnkbigr
Posted : Tuesday, October 10, 2017 1:38:14 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

How do i know how far back of a intraday data I have downloaded

and whats the max I have have 

Bruce_L
Posted : Tuesday, October 10, 2017 1:48:18 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
thnkbigr
Posted : Tuesday, October 10, 2017 1:53:56 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

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  

Bruce_L
Posted : Tuesday, October 10, 2017 1:56:48 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
thnkbigr
Posted : Tuesday, October 10, 2017 2:06:54 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

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 

Bruce_L
Posted : Tuesday, October 10, 2017 2:10:36 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
thnkbigr
Posted : Tuesday, October 10, 2017 2:15:37 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 2,915

How do i check the install date 

 

Bruce_L
Posted : Tuesday, October 10, 2017 2:22:40 PM


Worden Trainer

Joined: 10/7/2004
Posts: 60,672

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
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.