Previous day close from intraday time frame (5M,15m,30m etc.)

Hi All,
I wrote a script to extract previous day close using the following code:

d_Close1 = TimeFrameGetPrice("C",inDaily,-1);

The day close value is perfect when the timeframe is at day level. But when I switch to time frame less than day it is showing different value. From my understanding at day level, the price shown as close is “settlement price” and at intraday time frame, the close price was the last executed price when the trading session was closed.

So what should i do to get the day level close at the intraday level as well.

Thanks in advance

Hello,

check if the mode is the one you need, in the last parameter of the function : http://www.amibroker.com/guide/afl/timeframegetprice.html

The other issue might be the the intraday to daily compression settings: http://www.amibroker.com/kb/2006/03/19/how-does-the-daily-time-compression-work/

1 Like

HI pmxgs,
I checked the daily compression settings and they are as per the guidelines. I looked into the timeframegetprice as well but it didn’t help. I checked other values like open, high and low, but found that they are displaying well.

Let me reiterate in detail with example, so that i can make my understanding correct if any mistake.

Example:
When the trading session closes the last trade price as 98.5. But when the day closes the settlement price was 97.8. Now the close at day Timeframe is showing properly (97.8) but when i switch to intraday, this is showing the last trading price at intraday level (98.5).

Please let me know if i miss or misunderstand anything.

Now i need 97.8 to be shown at all time frame when i query for day close.

Without knowing more details it’s difficult to understand why that is happening… but from what you are describing it seems that your Daily data is not a compression of intraday data, otherwise you would be able to get the daily close from intraday prices.

Which data source are you using?

Apologies for delayed response.

I am using data from Global data feeds, a company in India. Is there anything that i need to get clarified from the data provider.

We don’t support Global data feeds 3rd party.
They may be sending data incorrectly or you might have configured wrong but as I said, this plugin is not supported.

Check the configuration as explained in the links @pmxgs has given

Check also this: http://www.amibroker.com/kb/2014/11/18/how-to-plot-daily-high-and-low-on-intraday-chart/

A full list of compatible data sources is available here:
http://www.amibroker.com/guide/h_quotes.html

and only sources listed here are supported by us.