Indicators: Correlation market state

 

Correlation market state:

Correlation market state

Correlation market state

Author: Mladen Rakic

 
Automated-Trading:

Correlation market state:

Author: Mladen Rakic

Thank you for your work.

 

Thank you for your wonderful indiactors.

I tested the three correlations indicators (Correlation market state, Correlation phasor and Correlation angle) in one expert advisor and they look promising.

Thanks again,

dP_Eng

Correlation market state
Correlation market state
  • www.mql5.com
General description : In his June 2020 TASC article "Correlation as a cycle indicator" John Ehlers describes one possible way to determine trend in the markets His article describes 3 possible ways of determining the trend and here we shall post all the 3 possible ways  This version :
 
Is there an MT4 version?
 
MT4 pls.
 

I'm not able to call the indicator via EA, keep getting 'indicator error'. 

Anyone has the same issue?

 
Quang Chi Pham #:

I'm not able to call the indicator via EA, keep getting 'indicator error'. 

Anyone has the same issue?

Nothing wrong with the indicator. Check and fix your code

Test code : 

input string             inpPath      = ""; // Indicator path
input int                inpPeriod    = 35; // Period
input int                inpBarToTest = 1;  // Bar to test

int indicatorHandle;

int OnInit()
{ 
   indicatorHandle = iCustom(_Symbol,_Period,inpPath+"Correlation market state",inpPeriod);
      
   if (indicatorHandle==INVALID_HANDLE) return(INIT_FAILED);
                                        return (INIT_SUCCEEDED); 
}
void OnTick()
{
   double _values[];
   double _valuesCopied = CopyBuffer(indicatorHandle,2,inpBarToTest,2,_values);
      if (_valuesCopied==2)
               Comment(TimeLocal(),"\n   Value of bar ",(int)inpBarToTest," : ",_values[1],"\n   Value of bar ",(int)(inpBarToTest+1)," : ",_values[0]);
}

Test code execution results :