Rank: Member
Groups: Registered, Registered Users Joined: 11/10/2008(UTC) Posts: 22
|
I am developing an Intraday model and one of my parameters requires that I find the CLOSE price of the Nasdaq market index the day before. Thanks to a helpful post on this forum, I was led to the following formula code to achieve this:
newDay:=DayOfMonth()<>Ref(DayOfMonth(),-1); ValueWhen(1,newDay,Ref(Security("ONLINE:$COMPQ",C),-1))
So the code is looking for a change in date (which always happens when shifting from one day to the next), and then gives me the Close of the security (this is the eSignal online feed for the Nasdaq), one bar prior to that date change. I am using a 5-min intraday feed from eS to achieve this.
Here is where my problem is:
When I look at the result from this formula, it CORRECTLY finds the date change. And it CORRECTLY returns the Closing price of a bar from the day before. HOWEVER, strangely it is grabbing the Closing price of the bar for 4:00PM. That sounds all well and good, but...when I look at the raw data in a bar chart, there is a bar at 4:05PM which contains the TRUE Closing price as reported by the market (i.e. if I look up the Close for that date on a daily chart).
So... for some reason my code is ignoring completely the bar at 4:05PM which has the right information in it, and it is giving me a result that is close, but slightly wrong as compared to the true market result. It's not a huge difference usually, but (a) in principle it is wrong, and (b) markets have been so volatile at the end of the day recently there are in fact some sizeable discrepancies between this formula and the true market Close.
Anyone have any ideas how to get the code to grab the correct market Closing result? Thanks!
P.S. I tried a different tactic and forced it to grab a bar from the previous day from Hour()=16 and Minute()=5, but it returned a null. It's almost like that bar isn't visible to the code, but I sure see it on the chart...
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
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.