bexar
June 20, 2017, 7:23am
#1
Using following code to read close on 14 June 2017
Apply to - my watch list, Range - all quotations
EOD Quotes downloaded from Yahoo
Exploration screen shows no prices
What am I doing wrong?? Using AB 5.0, and ‘yes’ I know it’s old, but so am I!!
[code]
// AFL to read close price on 14/June/2017/
// Datenum calculated as being
//(10000 * (2017 - 1900)) + (100 * 6) + 14 = 1170614
Filter = DateNum() == 1170614;
AddColumn (Close, “14 June 2017 Close”);
[/Code]
Tomasz
June 20, 2017, 8:19am
#2
The code is correct but you need to have data for that particular day in your database.
bexar
June 20, 2017, 8:27am
#3
Tomasz,
I’m assuming that there is data in the database because when I point to that date on a chart, the window pops up with the hi, lo, close, etc., values. Would this not be an indication that the close price is in the database? What else could I do to confirm?
Thank you!
pmxgs
June 20, 2017, 9:38am
#4
Hi,
I tried your code and it works.
Do you have Periodicity set do Daily?
bexar
June 20, 2017, 12:03pm
#5
PMXGS,
If you mean am I looking at daily charts vs weekly or monthly, ‘YES’ I’m looking at daily charts.
If there is a Periodicity setting somewhere else, I DON"T KNOW!
Where is the ‘Periodicity’ setting located??
Thanks
bexar
June 20, 2017, 12:10pm
#6
PMXGS,
Yep, that is my problem.
Auto Analysis > Settings > General > Periodicity now set to Daily!
Works fine now,
Thank you - you are brilliant!
now if we have to get weekly levels or monthly or yearly how do we do is it possible or DOES it work only for daily period ?
You can get price arrays from other timeframes using TimeFrameGetPrice()