Home
Software
Prices
Download
Yahoo Charts
NEW:
ADVANCED
TRADESTATION TECHNIQUE
US Markets Daily
snapshots
Technical
Description
| |
FUZZY RSI
This indicator uses the same template as Fuzzy StoK. There is basically
very little to change to create any new custom fuzzy indicator. All you
need is to make sure Input1 and Input2 are normalized to the [-1:+1] range.
EasyLanguage Code:
input: // The first 3 parameters are used by the FLC
int RSILen(14), // indicator specific
int SmoothingFactor(3), // indicator specific
int MomLen(1), // indicator specific
int Attenuation(2),
int Shape(0), // Shape : 0 for 3x3, 1 for 5x5
int FuzzySet1(0), // Fuzzy Set Model for Input1
int FuzzySet2(0), // Fuzzy Set Model for Input2
int FuzzySet3(0), // Fuzzy Set Model for Output
int FuzzySetLabels1(0), // Fuzzy Set labels for Input1
int FuzzySetLabels2(0), // Fuzzy Set labels for Input2
int FuzzySetLabels3(0), // Fuzzy Set labels for Output
int RuleSetModel(0); // Default Rule Set Model
vars:
bool Verbose(false),
int FLCnumber(0),
double Input1(0),
double Input2(0),
double Output(0),
double Output1(-1),
double Output2(-1),
double Output3(-1),
double Output4(-1),
double Output5(-1);
array:
double Outputs[5](-1);
Input1 = Xaverage(RSI(Close, SmoothingFactor) / 50 - 1,SmoothingFactor);;
Input2 = MomSigmoid(Input1,MomLen, Attenuation);
Output = FLC_Single(
FLCnumber,
Input1,
Input2,
Output1,
Output2,
Output3,
Output4,
Output5,
Shape,
FuzzySet1,
FuzzySet2,
FuzzySet3,
FuzzySetLabels1,
FuzzySetLabels2,
FuzzySetLabels3,
RuleSetModel);
if Currentbar = 1 then print ("FLC Number: ", FLCnumber:0:0);
if Output >= -1 then
begin
If Output>0 then
begin
if Output >= Output[1] then
SetPlotColor(1,Cyan)
else
SetPlotColor(1,Blue);
end
else
begin
if Output <= Output[1] then
SetPlotColor(1,Red)
else
SetPlotColor(1,DarkRed);
end;
plot1(Output,"FuzzyRSI");
plot2(Input1,"I1");
plot3(Input2,"I2");
if lastbaronchart and Verbose then print("FuzzyRSI FLC ", FLCnumber:0:0," ",
output,
Output1, Output2, Output3, Output4, Output5);
end
else
begin
NoPlot(Plot1);
if lastbaronchart then print("FuzzyRSI FLC", FLCnumber:0:0, " runtime error: ",
Output:0:0);
end;
MOMSIGMOID
MonSigmoid is a custom normalised gradient or momentum
indicator:
Inputs:
double Series(numericseries),
int Length(numeric),
double Attenuation(numericsimple);
{
This function uses a standard sigmoid transform
to squash large momentum values.
Output is range bound: [-1:+1]
'Length' and 'Attenuation' must be positive
}
MomSigmoid = 2 / ( 1 + expvalue( -Attenuation * (Series - Series[Length]) ) ) -
1;
|