I'm trying to load price/volume and various financial data into 2 separate tickers from Amiquote.
As an example;
AAPL.US would have normal price/volume data.
AAPL_F.US could have EPS loaded into "Open". Revenue loaded into "Close". etc.
I have 2 separate "Data sources" configured for downloading each, but using the same Ticker list (AAPL.US)
I have a javascript parsing the json response and the csv ouput looks good.
But now to my question;
How can I assign the $NAME header to be "AAPL_F.US" when it was called from the Ticker "AAPL.US"?
I can assign a header "Ticker" in the output rows, and call the ticker ( then add _F.US) but it doesn't help me to import the data to AB under a separate ticker as the $NAME AAPL.US is automatically generated.
I cannot use the Translation table as I also use the original ticker.
My API with trial key:
https://eodhistoricaldata.com/api/f...FQ67YX&filter=General::Code,Earnings::History
Current output:
$NAME AAPL.US
#Date, Ticker,Open,High,Low,Close,Adjusted_close,Volume
2021-09-30,AAPL_F.US,1.24,,,,,,
2021-06-30,AAPL_F.US,1.3,,,,,,
2021-03-31,AAPL_F.US,1.4,,,,,,
2020-12-31,AAPL_F.US,1.68,,,,,,
Javascript:
function Process( input )
{
var data = JSON.parse(input);
var history = data['Earnings::History'];
var name = data['General::Code'];
var keys = [];
for(var key in history){
keys.push(key);
}
var csv = '#Date, Ticker,Open,High,Low,Close,Adjusted_close,Volume\n';
for(var i = 0; i < keys.length; i++){
csv += history[keys].date + "," + name + "_F.US" + "," + history[keys].epsActual + ",,,,,,\n";
}
return csv;
}
Any help is appreciated!
As an example;
AAPL.US would have normal price/volume data.
AAPL_F.US could have EPS loaded into "Open". Revenue loaded into "Close". etc.
I have 2 separate "Data sources" configured for downloading each, but using the same Ticker list (AAPL.US)
I have a javascript parsing the json response and the csv ouput looks good.
But now to my question;
How can I assign the $NAME header to be "AAPL_F.US" when it was called from the Ticker "AAPL.US"?
I can assign a header "Ticker" in the output rows, and call the ticker ( then add _F.US) but it doesn't help me to import the data to AB under a separate ticker as the $NAME AAPL.US is automatically generated.
I cannot use the Translation table as I also use the original ticker.
My API with trial key:
https://eodhistoricaldata.com/api/f...FQ67YX&filter=General::Code,Earnings::History
Current output:
$NAME AAPL.US
#Date, Ticker,Open,High,Low,Close,Adjusted_close,Volume
2021-09-30,AAPL_F.US,1.24,,,,,,
2021-06-30,AAPL_F.US,1.3,,,,,,
2021-03-31,AAPL_F.US,1.4,,,,,,
2020-12-31,AAPL_F.US,1.68,,,,,,
Javascript:
function Process( input )
{
var data = JSON.parse(input);
var history = data['Earnings::History'];
var name = data['General::Code'];
var keys = [];
for(var key in history){
keys.push(key);
}
var csv = '#Date, Ticker,Open,High,Low,Close,Adjusted_close,Volume\n';
for(var i = 0; i < keys.length; i++){
csv += history[keys].date + "," + name + "_F.US" + "," + history[keys].epsActual + ",,,,,,\n";
}
return csv;
}
Any help is appreciated!