vince-ac Posted April 24, 2010 Report Posted April 24, 2010 could one of the talented coders please add an alert to this indicator. i was looking for a visual,sound and email, on the CLOSE of the candle when it crosses the line. thank you much in advance.................vince-ac http://www.4shared.com/file/v3tGoBKV/i-CAi2.html Quote
vince-ac Posted April 28, 2010 Author Report Posted April 28, 2010 i'm wondering if i put this request in the right forum. if i did, would the moderator please move it to the correct place? thank you.........vince-ac Quote
Acerinvest Posted April 28, 2010 Report Posted April 28, 2010 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"); } //+------------------------------------------------------------------+ Quote
vince-ac Posted April 28, 2010 Author Report Posted April 28, 2010 thanks acer, will give it a try rite-away.............vince-ac Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.