// Downloaded From https://www.WiseStockTrader.com
_SECTION_BEGIN("Ultimate StochK");

//--- Chart/Indicator Mode ---------------------------------------------------------------
	p1 = Param("Slow Period", 32);
	p2 = Param("Medium Period", int(p1/2));
	p3 = Param("Fast Period", int(p2/2));

	stk1 = StochK(p1,3);
	stk2 = StochK(p2,3);
	stk3 = StochK(p3,3);

	UltStk = (stk3 * (4/7)) + (stk2 * (2/7)) + (stk1 * (1/7));

	//Plot(UltStk, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style"));
	Plot(UltStk, Date()+" "+_SECTION_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style"));
	//Plot(80, "", colorRed, styleLine | styleNoLabel);
	//Plot(20, "", colorBlue, styleLine | styleNoLabel);
	PlotGrid(80, colorRed);
	PlotGrid(20, colorBlue);

	GraphXSpace = 5;
//--------------------------------------------------------------------------------------- 


//--- Exploration Mode ------------------------------------------------------------------
	// consensus rating
	ExtremeOversold = UltStk < 10;
	Oversold = UltStk > 10 AND UltStk < 20;
	Neutral = UltStk > 20 AND UltStk < 80;
	Overbought = UltStk > 80 AND UltStk < 90;
	ExtremeOverbought = UltStk > 90;

	ConsensusRating = WriteIf(ExtremeOversold, "Extreme Oversold",
							WriteIf(Oversold, "Oversold",
							WriteIf(Overbought, "Overbought",
							WriteIf(ExtremeOverbought, "Extreme Overbought", "Neutral"))));

	Filter = 1; 
	AddColumn(UltStk, "UltStk");
	AddTextColumn(ConsensusRating, "Rating");
	AddTextColumn( WriteIf(UltStk > Ref(UltStk,-1), "Up", "Down"), "Direction");
//--------------------------------------------------------------------------------------- 

_SECTION_END();