what is wrong in my code
as you see in the screenshot, for example (symbol LG), i have oSlowK = 37.28 and i have zone = OverBot whereas OverBought=80
here the code
Code: Select all
{ Stochastic Indicator }
Inputs:
PriceH(High), PriceL(Low), PriceC(Close), StochLength(9),
SmoothingLength1(3), { used to slow FastK to FastD = SlowK }
SmoothingLength2(3), { used to slow FastD to SlowD }
SmoothingType(1), { pass in 1 for Original, 2 for Legacy }
OverSold(20), OverBought(80), Width(2);
Variables:
oFastK(0), oFastD(0), oSlowK(0), oSlowD(0), Zone(" "), StoMA(" ");
Value1 = Stochastic( PriceH, PriceL, PriceC, StochLength, SmoothingLength1,
SmoothingLength2, SmoothingType, oFastK, oFastD, oSlowK, oSlowD ) ;
// OverSold & OverBought
If oSlowK <= OverSold then
Begin
Zone = "OverSld";
Plot1(Zone, "Zone", Red);
End
Else if oSlowK >= OverBought then
Begin
Zone = ("OverBot");
Plot1(Zone, "Zone", Green);
End
Else
Zone = "---";
Plot3(oSlowK, "oSlowK",green);