FUZZY STOK INDICATOR

Home Up Next

 

Home
Software
Prices
Download
Yahoo Charts


NEW:
ADVANCED
TRADESTATION TECHNIQUE

US Markets Daily
snapshots

Technical
Description


Forthcoming Releases:

Fuzzy Logic:
sFLC3
DLL & API


Neural Net:
Release of NXL3
DLL & API


 

FUZZY STOK INDICATOR

This indicator is a Fuzzy StoK indicator.  There is basically very little to change to create any new custom fuzzy indicator since any new indicator will basically just construct inputs and parameters and then call the FLC_Single function which takes care of everything. 

All you need to do really is to make sure Input1 and Input2 are normalized to the [-1:+1] range.  Many Fuzzy applications use a feedback variable (Composite or singular output sent back as Input2).

 

EasyLanguage Code:

input: // The first 3 parameters are used by the FLC
int StoLen(14), // indicator specific
int SmoothingFactor(3), // indicator specific
int MomLen(1), // indicator specific
int Attenuation(3),

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((SlowK(StoLen)/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("FuzzyStoK. FLC Num: ", 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,"FuzzyStoK");
plot2(Input1,"I1");
plot3(Input2,"I2");
if lastbaronchart and Verbose then print("FuzzyStoK FLC ", FLCnumber:0:0," ", output,
Output1, Output2, Output3, Output4, Output5);
end
else
begin
NoPlot(Plot1);
if lastbaronchart then print("FuzzyStoK FLC ", FLCnumber:0:0," runtime error: ", Output:0:0);
end;
 


Return to page: Fuzzy LogiceL for TradeStation


Home Up Best viewed with MS Internet Explorer 5 and above

Page last modified: May 08, 2008
Copyright ForeTrade Technologies 21st century and thereafter