(I’m using Amibroker 6.30.5 64bit licensed version.)
When I try to fetch Previous Day Close price from 5 min timeframe (using TimeFrameGetPrice( "C", inDaily, -1 )), I get the Close price of the last 5 min candle of yesterday, rather than the actual close price of yesterday (daily).
_SECTION_BEGIN( "Previous Day" ); PDH = TimeFrameGetPrice( "H", inDaily, -1 ); PDL = TimeFrameGetPrice( "L", inDaily, -1 ); PDC = TimeFrameGetPrice( "C", inDaily, -1 ); _SECTION_END(); Filter = 1; AddColumn (PDH, "Prev Day High"); AddColumn (PDL, "Prev Day Low"); AddColumn (PDC, "Prev Day Close");
If I change the periodicity to ‘Daily’ in Analysis window, and fetch the Close price of previous day (using TimeFrameGetPrice( "C", inDaily, -1 )), I get the correct value as per the NSE stock exchange data.
I have referred to an earlier post on this in 2017 [Previous day close from intraday time frame (5M,15m,30m etc.)]
I see there is no issue with the data provider (Global Data Feeds) as the ‘Daily’ data is indeed received correctly and stored in the database.
I’m able to fetch the actual daily close price in the Daily timeframe. So no issues in AmiBroker as well.
But when attempted to fetch in 5 min timeframe it doesn’t give the actual daily close price but the close price of the last 5 min candle of previous day.
I have tried using the timeframe set, restore and expand method, but still get the close price of the last 5 min candle of previous day.
(I understand that the Close price of the Daily candle will be the weighted average price of the last 30 mins and will differ from the lower timeframe last candle close. So no confusions there.)
The implication of the issue is in calculating the Pivot, Support, Resistance values for Intraday trading with yesterday’s OHLC. As there is difference in Yesterday Close value, the pivots shift affecting entry and exit.
Hope I have provided enough details and have communicated the issue properly.
Could someone assist me in getting the actual daily close from the 5 min timeframe.