clx47
April 27, 2019, 4:17am
#1
Guys Please Help, I can't figure it out how to make bollinger band line go to the front and not at behind of the candle:
_SECTION_BEGIN("Bollinger Bands");
P = ParamField("Price field",0);
Periods = Param("Periods", 14, 2, 300, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorCycle );
Style = ParamStyle("Style");
Plot( BBandTop( P, Periods, Width ), "BT" + _PARAM_VALUES(), colorGrey50, styleNoLabel );
Plot( BBandBot( P, Periods, Width ), "BB" + _PARAM_VALUES(), colorGrey50, styleNoLabel );
_SECTION_END();
this just default bollinger code..
Any solution or code that i need to add ??
Thanks
In the two Plot() functions, you can change the Zorder value to something higher than default 0, like 2.
It is explained here in detail:
https://www.amibroker.com/guide/afl/plot.html
2 Likes
Tomasz
April 27, 2019, 9:39am
#3
Or change the ordering of Plot() calls.
4 Likes
clx47
April 28, 2019, 3:28am
#4
Thanks guys, you are so kind to help
i just add " graphzorder = 1; "
_SECTION_BEGIN("Bollinger Bands");
graphzorder = 1;
P = ParamField("Price field",-1);
Periods = Param("Periods", 14, 2, 300, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorCycle );
Style = ParamStyle("Style");
Plot( BBandTop( P, Periods, Width ), "BT" + _PARAM_VALUES(), colorGrey50, styleNoLabel );
Plot( BBandBot( P, Periods, Width ), "BB" + _PARAM_VALUES(), colorGrey50, styleNoLabel );
_SECTION_END();
Great
clx47
April 28, 2019, 2:23pm
#5
@travick , i try use " graphzorder = 1; "'
but it bring all indicator on top candle include MA, please if You have time, give me example with code how to use Zorder with Bollinger Band, sorry i'm not advance in coding.
Thanks
You were not supposed to use or set the graphzorder = 1;
special variable.
Instead, you are supposed to define the ZOrder for the specific Plot() calls that you want to affect.
Only these two lines are supposed to be changed:
Plot( BBandTop( P, Periods, Width ), "BT" + _PARAM_VALUES(), colorGrey50, styleNoLabel, NULL, NULL, 0, 2 );
Plot( BBandBot( P, Periods, Width ), "BB" + _PARAM_VALUES(), colorGrey50, styleNoLabel, NULL, NULL, 0, 2 );
Look at the code above and just modify those parameters. Changing graphzorder
is a completely different thing.
2 Likes
clx47
April 28, 2019, 2:55pm
#7
Yeah this what i need, i have try it and succesfully
Thanks a lot @travick