|
QAndi
2013-02-10 21:52:49
|
|
Hi there,
I'm starting a script in the Tools/Script Editor:
HistoricalQuotes quotes = Quotes.GetHistoricalQuotes("NameOfAnySymbol");
Just with this one Line I got at Execution time' an error-messagebox telling me:
(translated:) 'The object reference was not [assigned|defined] to an object instance"
It sounds to me, as I'm used a type, instead an instance. But the object Quotes is already an instance by default (?)
Sadly, the error message does not define more clearly what it mean (The object Quotes? The result of its function?)
Any Ideas?
Thanks in advance
Andi
|
|
|
|
QuantShare
2013-02-11 11:51:50
0
|
|
Best Answer
Hi,
You should type a symbol name that already exists in your database.
Example:
HistoricalQuotes quotes = Quotes.GetHistoricalQuotes("GOOG");
|
|
|
|
QAndi
2013-02-16 16:48:01
0
|
|
Hi QS, sry for the delayed response.
Your're right! I missed the Yahoo suffix for the symbols, so from the scripts point of view, the symbol(s) wasn't there.
So the Error regards to to the resulting Object. Feature Request: It would be greate, if error messages tells also the instance name, they are depending on.
Thanks for your help!
|
|
|
|
QAndi
2013-02-27 01:15:01
0
|
|
Hi there,
I've less time, so I'm slow on the way ...
I want to get EoD Data from my Intraday Data. My Function already walks from the last EoD Date over the Intraday Data and summarizes the Intraday to EoD Data - so far so good.
Now I want to write the EoD Data into the Quotes Database.
Question 1:
I haven't found any Add Method or similar, so I have to create a very new Array with additional length, put the old current Array-Data into and fill the additional Elements with the new EoD Elements. And this I have to do with every Field in the Database (Open, Close, High, Low, Volume, Date). Is this really the one and only way?
Question 2: I get again the Error ''The object reference was not [assigned|defined] to an object instance", this time because my DatabasesData object is still null after creation.
My code looks like this:
DatabasesData dbOpen = Databases.GetDatabasesData("ALV.DE", "Quotes", "Open"); // This line ist executed without errors
int length = dbOpen.Value.Length // Here I get the Error
ALV.DE exists in My Database Quotes.
Any Ideas ?
|
|
|
|
QuantShare
2013-02-27 12:34:40
0
|
|
Question 1:
Yes. You have to update every Array (OHLCV and Date).
Question 2:
The function "Databases.GetDatabasesData" gets custom data. To get quotes, you have to use the "Quotes.GetHistoricalQuotes" function.
|
|
|
|
QAndi
2013-02-28 02:33:13
0
|
|
Oh - my fault x-/
thanks
I have a difference between last EoD Date (say 22.01.) and last intraday (say 27.02). So I'm walking throu the intraday data and summarizing EoD Data at Date change.
I don't know how many days it will be.
It's fine to use ArrayList's for this Job, because of the available Add method. Unfortunality I can't write them back to HistoricalQuotes because of no ability of autoboxing.
The better way would be to use generics, e.g. List<T>, but System.Collections.Generic Objects doesn't work. Is this a limitation of QS ?
For now I do the basic job with a for loop ...
|
|
|
|
QuantShare
2013-02-28 10:41:45
0
|
|
Generic collections work in QuantShare
Example:
System.Collections.Generic.List<double> list = new System.Collections.Generic.List<double>();
Once done, you can convert the list to "double[]" using "list.ToArray()"
You can also use "ArrayList" to add values then convert that array list into "double[]" at the end.
|
|
|
|
QAndi
2013-02-28 21:29:03
0
|
|
Oh - great! :-)
I used the dot notation: Sys<STRG>+<SPACE>-<dot>Coll<ENTER>-<dot>Gen<ENTER>-<dot>Lis<ENTER> ...
and got "System.Collections.Generic.List`1"
This threw an Error at usage.
So may only the ui component of Gerneric-Selection is broken.
I tried it now with the right names: it works :-)
regards
QAndi
|
|
|
|
Alpha Trader
2018-04-14 20:41:12
0
|
|
Hi there, I'm working our similar issues.
Pulling Quotes from Quotes database and trying to muliply them by values in a custom database.
Whats the best way to convert the DatabasesData.Value object to a double?
|
|
|
|
QuantShare
2018-04-16 06:27:39
0
|
|
By casting them to double type
double a = (double)......;
|
|
|
|