Bear with the length of this but it is confusing the heck out of me. When I run this statement in trading view on a Daily Chart:
open1 = request.security(syminfo.tickerid, "M", open[12])
and put open1 in a table cell, I expect to get the previous year's monthly open for the current month put into the cell. Since the current month is September, I expect to get last September's monthly open put into the cell when I run the statement. Here is what actually happens:
If it's after market hours, that statement puts the previous year's August monthly open into the cell and keeps it there.
If it's during market hours, the same statement initially puts the previous year's August monthly open in the cell, then a few seconds later last year's September monthly opened is entered into the cell (which is the value I'm expecting).
For example, as I type this, it's after market hours, and for MSFT, 420.79 gets put into the cell and stays there. Bu this is the previous year's August monthly opening price, and not what I'm asking for.
However, if I switch the chart to a Monthly chart, the same exact statement puts 417.91 into the cell, which is the correct value for the last September's monthly open for MSFT.
So in summary, when I run this statement during market hours on a daily chart, I get the correct monthly value entered into the cell, but not right away. For example using September as an example again, the August valule shows up first for a few seconds, and then September's value is written in.
After market hours, on a daily chart, running this statement gives the previous year's August monthly open and leaves it in the cell.
After market hours or during, on a monthly chart, the previous September's monthly open is entered into the cell, as expected.
Any idea of what is happening on the daily chart? I don't have a paid supscription to Trading View, so maybe that's somehow connected to the results I'm getting?
The statement in question is pretty cut and dry. It's September, and I want last September's monthly open. The statement should do that. On a daily chart, after market hours it's giving me the previous year's August monthly open.