Fetching next bar open price
Author: clarodina
Creation Date: 9/17/2008 8:50 AM
profile picture

clarodina

#1
hi anyone knows is there a synatx that fetch the open price of next bar? in ts this is accomplished by open next bar command.
profile picture

Eugene

#2
Open[bar+1], for backtesting.
profile picture

Cone

#3
Inside the Bars.Count loop, it's just
CODE:
Please log in to see this code.
However, you'll notice that this generates an error upon processing the last bar in the chart. Do you understand why?

The solution, then, is to not process the last bar - which is fine for backtesting, but isn't practical for trading.
CODE:
Please log in to see this code.


More discussion in the WL4 KB (same principles apply): Generating an Alert with the "Opening Price" of the Entry Bar
profile picture

kelvinyip

#4
Hi

I know yahoo data can give me a ghost bar for daily data. However, I want to run my sp500 symbol at the opening to scan for prices depending on opening price. If I use intraday data such as 1min, the time to collect the data is pretty long so I get a signal pretty late.

Is there any way I can use the ghost price daily data on fidelity's data (daily streaming) and test for my signal ? I see a method for partialbar but I am not sure if I need some special update like the one we see on yahoo data (to include partial ghost bar) in order for it to work

thx
profile picture

Cone

#5
First, see GetSessionOpen in the QuickRef. The problem is that for 500 symbols, this too will take a good amount of time (too long) to update all the opening prices, so you're not going to like that solution.

Streaming windows for 500 symbols isn't going to work for you either.

It's a shame we don't use the Quotes tool save Opening prices to global memory - the data are there, and it would be fast. Just wishful thinking though. :(
profile picture

kelvinyip

#6
thx. Let me see if there is any other way to get around it
profile picture

Cone

#7
It seems that it wouldn't take much (imho) to put the day's opening price into global memory for any symbol receiving data in the Quotes tool. It could be a delimited string like "Symbol|SessionOpeningPrice|IntegerDate" to avoid any ambiguities.

Anyway, don't count on getting it yet, but I'll add it to the wish list...
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).