Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

There you go. Translation looks a bit iffy.

 

//+------------------------------------------------------------------+

//| The strength of the Corrected Average (CA) is to

//|that the current value of the time series of the current one

//|excess volatility dependent threshold must

//|this increases the filter and falls, making false signals

//|be avoided in trendschwachen phases.

//|-A.Uhl-

//+------------------------------------------------------------------+

//|Germany, 23.03.2007

#property copyright "A.Uhl, © RickD 2006, Alexander Piechotta"

#property link "http://onix-trade.net/forum/"

//----

#define major 1

#define minor 0

//----

#property indicator_chart_window

#property indicator_buffers 1

#property indicator_color1 Gold

//----

extern int MA.Period=35;

extern int MA.method=MODE_SMA;

extern int MA.applied_price=PRICE_CLOSE;

//----

double MABuf[];

double CABuf[];

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

void init()

{

IndicatorBuffers(2);

SetIndexStyle(2, DRAW_LINE, STYLE_SOLID,1);

SetIndexDrawBegin(0, MA.Period);

//

SetIndexBuffer(0, CABuf);

SetIndexBuffer(1, MABuf);

IndicatorShortName("Corrected Average (CA) ("+MA.Period+")");

}

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

void deinit()

{}

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

void start()

{

int counted=IndicatorCounted();

if (counted < 0) return(-1);

if (counted > 0) counted--;

int limit=Bars-counted;

double v1, v2, k;

//----

for(int i=limit-1; i>=0; i--)

{

MABuf=iMA(NULL, 0, MA.Period, 0, MA.method, MA.applied_price, i);

if (i==Bars-1)

{

CABuf=MABuf;

continue;

}

v1=MathPow(iStdDev(NULL, 0, MA.Period, 0, MA.method, MA.applied_price, i), 2);

v2=MathPow(CABuf[i+1] - MABuf, 2);

//----

k=0;

if (v2 < v1 || v2==0) k=0; else k=1 - v1/v2;

 

CABuf=CABuf[i+1] + k*(MABuf-CABuf[i+1]);

}

if (Close[0] >= CABuf[0] && Close[1] <= CABuf[1]) Alert("Close crossed above signal line");

if (Close[0] <= CABuf[0] && Close[1] >= CABuf[1]) Alert("Close crossed below signal line");

 

}

//+------------------------------------------------------------------+

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...