Is latest data current / up to date ?
Author: sedelstein
Creation Date: 9/3/2013 11:08 AM
profile picture

sedelstein

#1
Apologies if posted before but my search came up negative.

Is there C# code to check whether the Fidelity data is up to date.

I don't want to act on a signal unless it is current as of the most recent trading day.
I can't tell for sure but I have a sneaking suspicion I generated a real trade on "old" data and I want to explicitly make sure by inserting some code.
profile picture

Eugene

#2
Have you tried
CODE:
Please log in to see this code.
?
profile picture

sedelstein

#3
Can use that, sure. But then there is comparing that with
CODE:
Please log in to see this code.
and checking the days between dates, the holiday schedule, etc....

If someone has already done that, it would be handy or a way of comparing
CODE:
Please log in to see this code.
with some date up there on the Fidelity site to confirm it is the latest date of update
profile picture

Eugene

#4
You could compare the last bar with the DateOfNextTradingDay() method from Community Components:
CODE:
Please log in to see this code.
profile picture

sedelstein

#5
Great, this works

Thanks for the help
profile picture

Cone

#6
Here's my take at it to prevent running the script if the data do no match the last market session date (EOD only).

CODE:
Please log in to see this code.
profile picture

sedelstein

#7
Wow. That's a great script as well.
Thank you
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).