LearnBuySell:
I prefer the y-axis with 0 to 100 is shown , plus two horizontal lines with values 20 and 80.
Following code failed me, please help, thanks.
In that case you do not need styleownscale
and styleleftaxisscale
(besides in general you should use either one or the other but not both in same plot line).
Also you can keep PloGrid
.
Simply add styleLeftAxisScale to Price plot.
_SECTION_BEGIN("StochD");
SetChartOptions(0,chartShowArrows|chartShowDates);
periods = Param( "Periods", 60, 20, 500, 20 );
Ksmooth = Param( "%K avg", 3, 1, 200, 1 );
Dsmooth = Param( "%D avg", 3, 1, 200, 1 );
Plot( StochD( periods , Ksmooth, DSmooth ), _DEFAULT_NAME(), colorGreen );
PlotGrid( 80, colorRed, 10, 1, True );
PlotGrid( 20, colorLime, 10, 1, True );
_SECTION_END();
_SECTION_BEGIN("Price");
SetChartOptions( 0, chartShowArrows | chartShowDates | chartWrapTitle);
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%), Vol %g {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );
Plot( C, "Close", ParamColor( "Color", colorDefault ), ParamStyle( "Style" ) | styleNoTitle | GetPriceStyle() | styleLeftAxisScale );
_SECTION_END();
// E.g.further indicator related to price plot
//_SECTION_BEGIN("SMA");
//Plot( MA(C, 50), "MA", ParamColor( "Color", colorDefault ), ParamStyle( "Style" ) | styleNoTitle | styleLeftAxisScale );
//_SECTION_END();
If you want to add e.g. MA() plot to Price then it should use styleLeftAxisScale
also.
BTW, it is mandatory rule to use code tags for inserting code(s) to post. Please do not forget next time.