Discussion of article "Fuzzy Logic in trading strategies" - page 6

 
Maxim Dmitrievsky:

Hi, you can read here https://www.mql5.com/en/articles/3856

also new article soon maybe, maybe not.. 

hi maxim

thank for your fantastic samples

when i debug this ea 


mql return error 

incorect casting of pointers on RuleParser.mqh line 712

please help to fix this bug 

my compiler version is

Version 5 build 2340 21 Feb 2020

many thanks to you

 
This is amazing... I implemented it with some small additions (like complementing the rules as suggested by author) in a triple channel' mean reversion strategy and improved its performance to the moon... thank you for sharing.
 
Hi, thanks your articles ,you taught me much ,thanks Maxim!
 

I have the following code which began with your one fuzzy system exmple

double CalculateMamdani()
{
// buffers and arrays normalized
 CopyBuffer(hnd1,0,0,1,arr1);
 NormalizeArrays(arr1);
   
 CopyBuffer(hnd2,0,0,1,arr2);
 NormalizeArrays(arr2);
    
 CopyBuffer(hnd3,0,0,1,arr3);
 NormalizeArrays(arr3);

 CopyBuffer(hnd4,0,0,1,arr4);
 NormalizeArrays(arr4);
   
 CopyBuffer(hnd5,0,0,1,arr5);
 NormalizeArrays(arr5);
    
 CopyBuffer(hnd6,0,0,1,arr6);
 NormalizeArrays(arr6);

 CopyBuffer(hnd7,0,0,1,arr7);
 NormalizeArrays(arr7);
   
 CopyBuffer(hnd8,0,0,1,arr8);
 NormalizeArrays(arr8);
    
 CopyBuffer(hnd9,0,0,1,arr9);
 NormalizeArrays(arr9);

// inputs - first fuzzy system [RSI]    
 firstTerm.SetAll(firstInput,arr1[0]);
 secondTerm.SetAll(secondInput,arr2[0]);
 thirdTerm.SetAll(thirdInput,arr2[0]);
 // inputs - second fuzzy system [CCI]]
 fourthTerm.SetAll(fourthInput,arr4[0]);
 fifthTerm.SetAll(fifthInput,arr5[0]);
 sixthTerm.SetAll(sixthInput,arr6[0]);
 // inputs - third fuzzy system [Stochastic]]
 seventhTerm.SetAll(seventhInput,arr7[0]);
 eighthTerm.SetAll(eighthInput,arr8[0]);
 ninthTerm.SetAll(ninthInput,arr9[0]);
 
 Inputs.Clear();
 // add terms - first fuzzy system [RSI]]
 Inputs.Add(firstTerm);
 Inputs.Add(secondTerm);
 Inputs.Add(thirdTerm);
// add terms - second fuzzy system [CCI}      
 Inputs.Add(fourthTerm);
 Inputs.Add(fifthTerm);
 Inputs.Add(sixthTerm);
 // add terms - third fuzzy system [Stockastic]
 Inputs.Add(seventhTerm);
 Inputs.Add(eighthTerm);
 Inputs.Add(ninthTerm);
 
 CList *FuzzResult=OurFuzzy.Calculate(Inputs);

 Output=FuzzResult.GetNodeAtIndex(0); // needs updating to account for three outputs not one !!!!!!!!
 
double res = Output.Value();

// add code for aggregation method on three outputs using weights

delete FuzzResult;

 return(res);
}

I am recoding so that it can handle three separate fuzzy systems

Clearly I need to consider the outputs from the three fuzzy systems

I would like to aggregate the three outputs using weights

Suggestions on completing the code most welome

Bob M

Dunedin

New Zealand