Hello I want to configure below formula
Currently percentage is showing not below 1.
I want the percentage as 0.5% 0.8 %.
Kindly help.
Thanks
_SECTION_BEGIN("MA Percentage Band");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", colorBlack, styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
P = ParamField("Price field",-1);
Periods = Param("Periods", 200, 2, 300, 1, 10 );
Percent = Param("Percentage %", 25, 1,100, 1, 10 );
SelectedIndicator = ParamList( "Show", "SMA,EMA,WMA,DEMA,TEMA", 1 );
if ( SelectedIndicator == "SMA" )
{
Positive_Percent_Band = MA( P, Periods )+ (MA( P, Periods )*percent/100);
Negative_Percent_Band = MA( P, Periods )- (MA( P, Periods )*percent/100);
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Positive_Percent_Band, "Positive %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Negative_Percent_Band, " Negative %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
}
else
if ( SelectedIndicator == "EMA" )
{
Positive_Percent_Band = EMA( P, Periods )+ (EMA( P, Periods )*percent/100);
Negative_Percent_Band = EMA( P, Periods )- (EMA( P, Periods )*percent/100);
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Positive_Percent_Band, "Positive %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Negative_Percent_Band, " Negative %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
}
else
if ( SelectedIndicator == "WMA" )
{
Positive_Percent_Band = WMA( P, Periods )+ (WMA( P, Periods )*percent/100);
Negative_Percent_Band = WMA( P, Periods )- (WMA( P, Periods )*percent/100);
Plot( WMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Positive_Percent_Band, "Positive %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Negative_Percent_Band, " Negative %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
}
else
if ( SelectedIndicator == "DEMA" )
{
Positive_Percent_Band = DEMA( P, Periods )+ (DEMA( P, Periods )*percent/100);
Negative_Percent_Band = DEMA( P, Periods )- (DEMA( P, Periods )*percent/100);
Plot( DEMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Positive_Percent_Band, "Positive %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Negative_Percent_Band, " Negative %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
}
else
if ( SelectedIndicator == "TEMA" )
{
Positive_Percent_Band = TEMA( P, Periods )+ (TEMA( P, Periods )*percent/100);
Negative_Percent_Band = TEMA( P, Periods )- (TEMA( P, Periods )*percent/100);
Plot( TEMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Positive_Percent_Band, "Positive %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Plot( Negative_Percent_Band, " Negative %", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
}
_SECTION_END();