I debug the above code. And observed in the watch list for the values inside the "closeprices".
Please find the attachments.
-> Is in amibroker the array size is 200? if yes then how to resize the array?
->why the array storing only last 40 bars(159 to 200) close prices only ?
Thanks for your quick help.
Please find the below code.
_SECTION_BEGIN("Title");
TimeFrameSet( in5Minute );
closeprices=Close;
//TimeFrameRestore(); // commented because if i use this i am getting 1 minute data.But i want 5 minute data
closeprices = TimeFrameExpand(closeprices, in5Minute);
printf("done");
_SECTION_END();
->If i comment the "TimeFrameRestore(); " and run the program in debug mode then getting the Data/Time in invalid date/Time for first 160 rows. How to get the correct date/Time?
Please find the attachment. See if i did not comment i am getting 1 minute data. Please find the attached screen shot .Getting data as 12:11, 12:12, 12:13, 12:14, 12:15 etc...
@Kum001 Didn't you notice, that each 5 (1-minute bars) have the same closing price?
Why? Because that's how 5 minute data looks in 1 minute timeframe.
You really need to understand how timeframe functions work and it is described in details in AB documentation. Besides you can find dozens of different codes using timeframe functions on the forum. Don't expect from other users repeating what you can easily find following the link given to you by @codejunkie . Just spend some time reading the documentation and analysing the examples.
Besides do you really need timeframe functions? if you need 5 minute data, simply change the chart's interval to 5-minute.
The orange boxes in the manual are used to highlight sections that you MUST READ. And you completely skipped/ignored that. So read the orange boxes in https://www.amibroker.com/guide/h_timeframe.html . All of them. From beginning to end and carefully/slowly. Once you do you will find out everything you did wrong in your formula.