How to keep preferred timeframe in daily, weekly and monthly views

I zoomed a price chart to display one year of candles in Daily View. I click on Weekly View and change the zoom setting to three years of candles which is the permanent setting I want to use. When I go back to Daily View, my zoom setting of one year of candles is changed.
How can I keep each zoom setting for daily, weekly and monthly views?
I tried using styleOwnScale | styleNoRescale on the price and volume plots but this did not help.

You can just save desired setups as separate LAYOUTS. Layout stores zoom factor, selected symbol and interval and you can switch between layouts by just double click, see the manual:
http://www.amibroker.com/guide/h_sheets.html

Or you can just create 3 MDI tabs (File->New->Default Chart) for daily, weekly and monthly view.

I am trying to set up the Daily view button so it shows exactly 18 months of data, and I want the Weekly view button to show exactly 3 years of data. I set the Daily view zoom to 18 months, but when I set the Weekly view to 3 years this destroys the Daily view zoom setting!

I set up MDI tabs for daily, weekly and monthly view but this did not fix the problem. Changing the zoom on one of them changes the zoom on the others.

I then set up three layouts for daily, weekly and monthly periodicity. However, when I change the zoom on one layout it still alters the zoom setting on the others.

No it doesn't.

In the video below, I am zooming in right-hand chart (Daily MDI tab). As it is clearly seen on video, left hand chart is unaffected.

video

Hi Tomasz,
In your example, in the weekly chart note the date of the first weekly bar before you File > Save as >weekly,chart.
Note the first daily bar date in the daily chart before saving it as daily.chart
Close both and then open them again.
When I open them again the zoom settings are lost and even the weekly periodicity - they both open as daily charts with different first bar dates.

Don't do "save as" for each chart. You don't need to save individual charts. And you don't need to save charts at all in AmiBroker. They are saved automatically as a part of layout. And no don't close charts. You are missing the whole point of layouts. You don't open / close charts constantly. You should work with LAYOUTS. Layouts are complete multi-chart setups saved as a whole, not individually.
Truly DO Read the manual about layouts, they are auto-saved by default
Working with chart sheets and window layouts (scroll down to LAYOUTS and carefully read that).

So you are doing it wrong. Leave charts open. Set zooms to whatever you wish. Close AmiBroker. Open AmiBroker. The default layout should be back in place with previously set zoom factors. NO SAVING necessary. NO closing charts, NO need to do anything. It just comes back in the way it was before you exited AmiBroker (if Tools->Preferences, "Misc" has auto-saving of layout enabled (it is by default)).

Here is what I want to do:
I have set up MDI tabs for Basic chart, OBV, MACD, RSI, etc.
Weekly scroll: Using exactly two years of bars (zoom setting 2 years) and 30 week MAs, I scroll through a watchlist clicking on each MDI tab for each symbol.
Next I do a Daily scroll: Using exactly one year of bars (zoom setting 1 year) and 150 day MAs, I scroll through a watchlist clicking on each MDI tab for each symbol.

I would love to simply double click on Weekly charts layout, scroll through each tab for each symbol, and then double click on Daily charts layout and have the view button, the zoom and moving averages instantly change to daily settings.

However, when I set up a Weekly charts layout and a Daily charts layout, they do NOT retain the zoom setting and the moving average periods in each layout.

I have read the manual on layouts, and understand that you don't need to save or close them once they are set up.

Here are some possible reasons that the zoom and MA period settings are not being saved:

  1. I am using the same price.afl formula for various MDI tabs, and also for the daily and weekly layouts. Do I have to use a different formula for each MDI tab and/or for each layout?
  2. Do I save formula in the Custom or the Drag-drop folder? Thereafter if I make any changes to the formula I simply click Apply.
  3. Some but not all formula have SetChartOptions with mode=0. Is this OK?
  4. Preferences, Charting, Reset zoom to default when loading layout is ticked. Default zoom number of bars 270.
  5. Preferences, Misc, Auto-save templates and layouts ticked.
  6. I am using Amibroker 6.39.1. Should I revert to 6.30.5?

No, zoom is NOT stored in formulas, and it is not stored in custom nor drag-drop folder, and version 6.30.5 is not better and you should not revert to anything.

Zoom is stored in the layout file.

And you should not have "MDI tab" for each symbol. You should have
TWO tabs: one for daily and one for weekly and scroll through symbols using DOWN ARROW on the symbol list. If you want to sync symbols use symbol link.

This is all shown in the video that I posted earlier and in the video below (red box next to scroll bar means that symbol link is activated). As it is clearly seen, zoom factor and interval in both charts is fully independent.

video

I have managed to get it working correctly. It required that every chart has a different chart id. For example, RSI daily and RSI weekly have different chart ids. This was the only way that different moving averages for daily and weekly charts would be stored without affecting each other. Each chart is fully independent of others. This was achieved by using Chart, Insert. (NOT Insert, Linked).
Thanks.

No, it doesn't need different chart IDs to get independent zoom. It just needs different MDI charts as shown in my pictures. Different Chart IDs are only needed for parameters
Chart zoom range and chart parameters (Param calls) are completely UNRELATED things.

Recommended reading:

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.