Australian (ASX) Stock Market Forum

Amibroker - correct code for a scale on the left?

Joined
6 July 2013
Posts
15
Reactions
0
I'm trying to plot an indicator in the same pane as the Price but need it to have its own scale on the left. Ive been playing around with the code inserting different variations using "StyleOwnScale" and "StyleLeftAxisScale" but somehow the plot and scale just doesn't look correct.

Basically the left scale needs to have a fixed range from 0.5 to 4.0 and in Log scale. Does anyone have any sample code that would achieve this?

Many thanks!
 
You should not combine both ownScale and LeftAxisStyle - use either one or the other. styleLeftAxisScale is the same as ownScale, however it allows to group few charts together (within the same scale, which is separate from the main one) - like this:

Plot( Close, "Close", colorBlack, styleCandle);
//separate charts:
Plot( RSI(), "RSI", colorRed, styleLeftAxisScale);
Plot( 30, "30", colorRed, styleDashed|styleLeftAxisScale);
Plot( 50, "50", colorRed, styleDashed|styleLeftAxisScale);
Plot( 70, "70", colorRed, styleDashed|styleLeftAxisScale);

As you can see – RSI is on a separate scale, however RSI and 30 and 70 lines share the same scale (so they don’t change position in relation to one another within this left-axis-scale group of charts).

You can have charts scaled separately inside a pane (with styleOwnScale /
styleLeftAxisscale), however you can't literally display additional axis on
the left-hand side.
http://www.amibroker.com/guide/h_indbuilder2.html
 
Thanks again D.. that did the trick! Do you mind if I ask you other very quick, unrelated question (which is actually the last question I have.. I promise..that is preventing me from getting fully up and runnning with AB)....

Whenever I open Amibroker to my default template/layout (which has multiple panes).. it seems that the bottom pane keeps changing its height (it gets bigger) which is a pain in the butt because every time, I have to keep resizing EVERY pane above it. Any ideas why its doing that?

You should not combine both ownScale and LeftAxisStyle - use either one or the other. styleLeftAxisScale is the same as ownScale, however it allows to group few charts together (within the same scale, which is separate from the main one) - like this:

Plot( Close, "Close", colorBlack, styleCandle);
//separate charts:
Plot( RSI(), "RSI", colorRed, styleLeftAxisScale);
Plot( 30, "30", colorRed, styleDashed|styleLeftAxisScale);
Plot( 50, "50", colorRed, styleDashed|styleLeftAxisScale);
Plot( 70, "70", colorRed, styleDashed|styleLeftAxisScale);

As you can see – RSI is on a separate scale, however RSI and 30 and 70 lines share the same scale (so they don’t change position in relation to one another within this left-axis-scale group of charts).

You can have charts scaled separately inside a pane (with styleOwnScale /
styleLeftAxisscale), however you can't literally display additional axis on
the left-hand side.
http://www.amibroker.com/guide/h_indbuilder2.html
 
Whenever I open Amibroker to my default template/layout (which has multiple panes).. it seems that the bottom pane keeps changing its height (it gets bigger) which is a pain in the butt because every time, I have to keep resizing EVERY pane above it. Any ideas why its doing that?

Can't reproduce it. It stays the same size here. You mean that you double click a different layout in the layouts window and only default one changes sizes if you switch back or does any layout change sizes if you switch back?

Have you checked autosave in tools-preferences-miscellaneous-autosave?
 
What happens is that I have a layout all neatly set out the way I want it with each pane at my desired height. Then I close Amibroker and open it again.. after opening, the pane heights have adjusted themselves to a different height, most notably the bottom pane.

The same thing happens even if I just narrow the width of the application on my screen as per below image:








Can't reproduce it. It stays the same size here. You mean that you double click a different layout in the layouts window and only default one changes sizes if you switch back or does any layout change sizes if you switch back?

Have you checked autosave in tools-preferences-miscellaneous-autosave?
 
Guess my animated image didn't show in my previous post because it was too big..


20140121.gif

What happens is that I have a layout all neatly set out the way I want it with each pane at my desired height. Then I close Amibroker and open it again.. after opening, the pane heights have adjusted themselves to a different height, most notably the bottom pane.

The same thing happens even if I just narrow the width of the application on my screen as per below image:
 
Looks strange. Never seen that. You should rather contact technical support of AB. They can probably tell you more.
 
Thanks for looking at at it anyway.. .sorry for my late reply (Chinese New Year holidays...). I did contact AB technical support and they were also a bit mystified by it... no solution yet, but I understand they plan to look into it). The speed of their response and helpfulness was certainly a nice change from from my existing TA software provider... ;) !!!


Looks strange. Never seen that. You should rather contact technical support of AB. They can probably tell you more.
 
Top