I use EOD data for tech analysis and use Weekly & Monthly timeframes to analyze overall trend to take trade on daily chart.
Moderator comment: it is NOT a problem. It is PROPER WAY of displaying charts!
One problem that I face is that when I select "Weekly" timeframe from the dropdown box on the Amibroker Menu, all the indicators and price chart show the data as of today instead of "Weekly" Price Chart and indicators ending on Last Friday's state and Monthly showing as of last month end.
For visual analysis it is distracting to see a monthly indicators on say 15th of Feb showing indicators as of 15th Feb. I kind of hide the last bar on all charts on weekly and monthly timeframes to ignore it; butit is annoying.
I know that it can be done programmatically by using Expandlast on timeframerestore; but I just want to use Amibroker's charting to do this instead of having to program every indicator and MAs and BBands and Price on every tab to achieve this.
Is there a setting that can tell Amibroker to achieve this?
You apparently are very new and very inexperienced.
What AmiBroker does is 100% correct.
The last bar is updated upto TODAY always, regardless of interval.
All professional charting programs work that way. All display live last bar. With the exception of very last tick of the minute/hour/day/month/year the last bar is always "partial", i.e. represents current minute/hour/day/month/year upto "current" time.
Not displaying last bar makes absolutely no sense at all, but if for some weird reason you want to hide the last bar, you can do so:
bi = BarIndex();
Plot( IIF( bi == LastValue( bi ), Null, Close ), "Price", colorDefault, styleCandle );
When analyzing weekly chart, everyone only uses price action and indicators as of last friday close. Nobody uses a partial weekly candle/indicator of the current week. If weekly trend is confirmed as of last friday, then you use current week's daily price action to make an entry point. That's a universal technical anaysis truth for multiframe trading.
Anyways, it might be prudent for a charting software to provide an option through a setting and leave it to the user, how user wants to use it.
May be all professional softwares do it that way. Perhaps Amibroker could do better than them.
Thanks for the code snippet. I will try using it for all my indicators and price charts.
I don't think you've thought this through Samir.
You're opening up a chart mid-week expecting to do end-of-week analysis? Why not peform the analysis when the week is completed? You're the one opening the chart! Take responsibility for the day you open it!
The problem here is that a "completed week" isn't the same for every situation.
What happens if there's a holiday on Friday? You open up a chart on Friday and "nothing" appears.
What happens if there are two (or more) consecutive holidays (or forced exchange closings due to weather or other external events) on Thursday and Friday.
Typically, the charting app has no knowledge of holidays.
They do. They all display a "progressive" chart for timeframes above daily, and some also do it for daily and below (I've used 30+ charting apps over the last 25 years).
In any case, this is probably a "data vendor" option rather than a charting app option.
In my original reply I wrote you the AFL formula that does what you want. So maybe you just use the code I have given to you.