Hello everybody, I have encountered a problem in pad and align ($SPX). Hope if anyone can point out where I am wrong.
Time frame for exploration: Weekly
Explore column: Closing price
Ticker: CRM (which was listed on June 23, 2004)
I found in 2nd image, first available weekly bar (6/30/2004) does not return any result.
But in fact, there is a weekly bar on 6/30/2004, as shown in 1st image.
The same problem applies if I set the exploration in monthly time frame.
Do you know why the first available bar reading is missing?
The 1st image: Pad and align is turned off
The 2nd image: Pad and align is turned on
@Pickle, I have a hypothesis but it's better to wait for @Tomasz's confirmation for the correct answer.
In the meantime, you can explore this by setting the periodicity to Daily with P&A enabled.
You'll notice that CRM has data starting only from June 23rd (Wednesday), meaning it has just three bars in its first trading week. However, since your P&A reference symbol includes bars for the two previous days (Monday and Tuesday), it seems that AmiBroker attempts to construct a weekly bar starting from Monday, based on the reference symbol.
Because CRM doesn't have any data for the actual start of the week (June 21st, Monday), the weekly bar cannot be created, as the required opening price is missing.
It seems credible to me... but I could also be completely wrong!