Hello,
I wrote my first indicator. There are many parameters of his indicator. There are default values for this parameters. But somehow when i add indicator to my chart default values looks wrong. For example, TrendBandTop_color parameter default value black and TrendBandTop_width default value 2, see below code. But when add indicator to chart i'm seeing that its color red and width 1. Could you explain me why?
INIT
indicator.parameters:addGroup("Calculation");
indicator.parameters:addInteger("BandDays", resources:get("param_BandDays_name"), resources:get("param_BandDays_description"), 28);
indicator.parameters:addDouble("DevConstant", resources:get("param_DevConstant_name"), resources:get("param_DevConstant_description"), 3.5);
indicator.parameters:addGroup("Style");
indicator.parameters:addColor("TrendBandTop_color", resources:get("param_TrendBandTop_color_name"), resources:get("param_TrendBandTop_color_description"), core.rgb(0, 0, 0));
indicator.parameters:addInteger("TrendBandTop_width", resources:get("param_TrendBandTop_width_name"), resources:get("param_TrendBandTop_width_description"), 2, 1, 5);
indicator.parameters:addInteger("TrendBandTop_style", resources:get("param_TrendBandTop_style_name"), resources:get("param_TrendBandTop_style_description"), core.LINE_SOLID);
indicator.parameters:setFlag("TrendBandTop_style", core.FLAG_LINE_STYLE);
indicator.parameters:addColor("TrendBandMiddle_color", resources:get("param_TrendBandMiddle_color_name"), resources:get("param_TrendBandMiddle_color_description"), core.rgb(0, 0, 0));
indicator.parameters:addInteger("TrendBandMiddle_width", resources:get("param_TrendBandMiddle_width_name"), resources:get("param_TrendBandMiddle_width_description"), 2, 1, 5);
indicator.parameters:addInteger("TrendBandMiddle_style", resources:get("param_TrendBandMiddle_style_name"), resources:get("param_TrendBandMiddle_style_description"), core.LINE_SOLID);
indicator.parameters:setFlag("TrendBandMiddle_style", core.FLAG_LINE_STYLE);
indicator.parameters:addColor("TrendBandBottom_color", resources:get("param_TrendBandBottom_color_name"), resources:get("param_TrendBandBottom_color_description"), core.rgb(0, 0, 0));
indicator.parameters:addInteger("TrendBandBottom_width", resources:get("param_TrendBandBottom_width_name"), resources:get("param_TrendBandBottom_width_description"), 2, 1, 5);
indicator.parameters:addInteger("TrendBandBottom_style", resources:get("param_TrendBandBottom_style_name"), resources:get("param_TrendBandBottom_style_description"), core.LINE_SOLID);
indicator.parameters:setFlag("TrendBandBottom_style", core.FLAG_LINE_STYLE);
PREPARE
TrendBandTop = instance:addStream("TrendBandTop", core.Line, name .. ".TrendBandTop", "TrendBandTop", instance.parameters.TrendBandTop_color, first);
TrendBandTop:setWidth(instance.parameters.TrendBandTop_width);
TrendBandTop:setStyle(instance.parameters.TrendBandTop_style);
TrendBandMiddle = instance:addStream("TrendBandMiddle", core.Line, name .. ".TrendBandMiddle", "TrendBandMiddle", instance.parameters.TrendBandMiddle_color, first);
TrendBandMiddle:setWidth(instance.parameters.TrendBandMiddle_width);
TrendBandMiddle:setStyle(instance.parameters.TrendBandMiddle_style);
TrendBandBottom = instance:addStream("TrendBandBottom", core.Line, name .. ".TrendBandBottom", "TrendBandBottom", instance.parameters.TrendBandBottom_color, first);
TrendBandBottom:setWidth(instance.parameters.TrendBandBottom_width);
TrendBandBottom:setStyle(instance.parameters.TrendBandBottom_style);