Charting options

I have unchecked "Show Value Labels" in preferences so that i dont see clutter of values highlighted for moving averages etc, but i still want current price to be highlighted - is that selective value selection feasible?

I like 20% of white space above the price chart and 20% below - are there any settings i can change that will enable me to accomplish this? I know i can do scroll zooming to accomplish this- but i like to preset it in preferences or even store it as a template and use it?

(snap to price % threshold - how does this work?)

Check "Show Value Labels" again. And instead use styleNoLabel in code.

e.g.

Plot( C, "Price", colorDefault, styleCandle );
Plot( MA(C,20), "SMA", colorRed, styleLine | styleNoLabel );

Use GraphXSpace in code

e.g.

GraphXSpace = 20;

Or go to price axis and until mouse cursor changes to vertical double arrow. Then hold SHIFT key and move mouse up and down by also holding left mouse button down (while double arrows still showing on price axis). To restore to default state double click on price axis.


It is explained in manual

  • Snap to price % threshold - defines how far price 'magnet' works, it will snap to price when the mouse is nearer than % threshold from H/L/C price

e.g. if drawing manual trend lines.

2 Likes

Most of your responses assumed that i use formula - but i use stand alone functionality.

Can i edit the formula and change as you suggested? Will the changes then persist as i close the Amibroker and restart? (Save it as chart template - so it does persist?)

Here is the formula - look:

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("EMA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

_SECTION_BEGIN("MA4");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

I bumped you in another thread, but you need to walk the last mile.

@fxshrat has explained in the most simplest of ways, still you're unable to.

see this part of your code

fault ), styleNoTitle | ParamStyle("Style") |

you need to add

| styleNoLabel

to each individual plot function, which need not display label on Y axis.

GraphXSpace = 20;

You can insert this code once in the AFL. Eg. insert after line # 3

1 Like

I did not assume that you use formula but I was very sure that you would use a formula because AB is formula driven (see your posted formula of your 2nd post). For example in order to plot a price you have to have a code line being applied on chart plotting price chart. So there always is a formula required to output something (e.g. on chart).

Disabling "Show Value Labels" of Tools-Preferences-Charting is global setting! But that's not what you wanted. So I said check it again and instead use code.

Now, what you did not do was posting a sample formula in your first post. So I was giving you two example code lines showing how to keep label for one plot and removing label for other plot. That's all. You need to study and understand examples.


Now in your second post you have posted a sample AFL. There you use ParamStyle function. Since you use that function for every plot styling in "your" code there is no need to add styleNoLabel of my previous example in every use case. Why? Because ParamStyle includes option for individually disabling label of each plot already.

So right click chart pane and choose Parameters in context menu. Then in each Indicator section of Parameter window look for Style option and open style drop down menu. Then look for NoLabel and check it where you want it to be enabled.

502

And yes, those formula driven param settings will be persistent on next restart of AB.

On the other hand if you want to rock solidly ensure persistency of "no label" for some of your plots of your AFL after every loading of a *.chart template (containing that AFL) then better add styleNoLabel to those Plot lines, e.g.

Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") | styleNoLabel ); 

Adding styleNoLabel to your existing code will override "NoLabel" setting of ParamStyle as "NoLabel" is hardcoded then. It makes "NoLabel" persistent for every use case such as loading chart template containing that code snippet (it will be persistent until styleNoLabel is removed from your AFL again (also chart template would have to be updated if you do not want that hardcoded "NoLabel" persistency anymore there)).


As for adding

GraphXSpace = 20;// change value to your needs

to "your" code. Whatever value you assign there to GraphXSpace it will also be persistent on next AB restart or after loading a *.chart template (where that AFL containing GraphXSpace is part of).

2 Likes