|
Chaim6
2014-11-03 01:13:09
|
|
In a Portfolio it is critical for the signals to be using up to date price data. How do you check if the price date is up to date?
This is necessary because sometimes the most recent download was a few months ago. Sometimes for a new symbol there was never any price data at all. How do you check for these issues and fix them?
thanks.
|
|
|
|
QuantShare
2014-11-04 01:40:08
0
|
|
You could create a watchlist, right click on it then select "Value -> Quotes -> Days since last update".
You know now exactly when each symbol was updated. You can of course create a filter based on that (Dynamic watchlist) and display only symbols that weren't updated since a N days.
|
|
|
|
Chaim6
2014-11-04 09:50:54
0
|
|
How about in a Simulation and/or a Portfolio? I would like the simulation to take an action (i.e. run a downloader and/or display a MessageBox()) when the price data is not up to date. Is there a way to do this?
What I am looking for is a way to retrieve the date of a symbol's first and last bar in the QS language and/or in C#.
Thanks.
|
|
|
|
QuantShare
2014-11-05 01:51:59
0
|
|
- The "Days since last update" value can be accessed using the "Symbols Selection" tool (New condition -> Quotes -> Days since last update).
For the portfolio tool, just click on "Status: nn symbols are not up-to-date" then click on "Download"
You can't do that using the simulator.
- "What I am looking for is a way to retrieve the date of a symbol's first and last bar in the QS language and/or in C#."
In "Create Function", type this:
VectorR r = cFunctions.GetTimeframeRawData("Symbol", 1, "close");
if(r.Length > 0)
{
DateTime first = r.GetDate(0);
DateTime last = r.GetDate(r.Length - 1);
}
|
|
|
|
Kaapro
2017-02-28 13:02:37
0
|
|
Hi,
My knowledge with C# is limited. I have created the function with the code above but it returns 0. I have added it as a column in watch list next to "Days Since Last Quote".
Could you check it again and let me know if i need to make any changes?
Thank you
|
|
|
|
QuantShare
2017-03-01 03:09:11
0
|
|
The code is not complete. In "Create Functions", you need to set a value to the variable "result".
Example:
VectorR r = cFunctions.GetTimeframeRawData("Symbol", 1, "close");
if(r.Length > 0)
{
DateTime first = r.GetDate(0);
DateTime last = r.GetDate(r.Length - 1);
result = first.ToString();
}
And at the bottom, you need to uncheck "Return Numeric Array" since the function will return a "string".
|
|
|
|