| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
|||
|
Hi, Codersguru,
This is Shaff Trend Cycle: #property copyright "Copyright © 2004, FostarFX." #property link "mail: fostar_fx@yahoo.com" #property indicator_separate_window #property indicator_minimum -10 #property indicator_maximum 110 #property indicator_buffers 1 #property indicator_color1 DarkOrchid //---- input parameters extern int MAShort=23; extern int MALong=50; extern double Cycle=10; extern int CountBars=300; //---- buffers double MA[]; double ST[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { // string short_name; //---- indicator line IndicatorBuffers(2); SetIndexBuffer(0, MA); SetIndexBuffer(1, ST); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2,DarkOrchid ); //---- //---- return(0); } //+------------------------------------------------------------------+ //| Schaff Trend Cycle | //+------------------------------------------------------------------+ int start() { SetIndexDrawBegin(0,Bars-CountBars+MALong+MAShort+1); int shift,u,counted_bars=IndicatorCounted(); double MCD, LLV, HHV, MA_Short, MA_Long, sum ,prev, smconst; int n, i, s; bool check_begin=false, check_begin_MA=false; double MCD_Arr[100]; if(Bars<=MALong) return(0); if (CountBars==0) CountBars=Bars; //---- initial zero if(counted_bars<MALong+MAShort) { for(i=1;i<=MALong;i++) MA[Bars-i]=0.0; for(i=1;i<=MALong;i++) ST[Bars-i]=0.0; } //---- shift=CountBars-MALong-1; // if(counted_bars>=MALong) shift=Bars-counted_bars-1; check_begin = false; check_begin_MA = false; n = 1; s = 1; smconst = 2 / (1 + Cycle/2); while(shift>=0) { MA_Short = iMA(NULL,0,MAShort,0, MODE_EMA, PRICE_TYPICAL, shift); MA_Long = iMA(NULL,0,MALong,0, MODE_EMA, PRICE_TYPICAL, shift); MCD_Arr[n] = MA_Short - MA_Long; MCD = MA_Short - MA_Long; if (n >= Cycle) { n = 1; check_begin = true; } else {n = n + 1;} if (check_begin) { for (i = 1; i<=Cycle; i++) { if (i == 1) {LLV = MCD_Arr[i];} else { if (LLV > MCD_Arr[i]) LLV = MCD_Arr[i]; } if (i == 1) {HHV = MCD_Arr[i];} else { if (HHV < MCD_Arr[i]) HHV = MCD_Arr[i]; } } ST[shift] = ((MCD - LLV)/(HHV - LLV))*100 + 0.01; s = s + 1; if (s >= (Cycle)/2) { s = 1; check_begin_MA = true; } } else {ST[shift] = 0;} if (check_begin_MA) { prev = MA[shift + 1]; MA[shift] = smconst * (ST[shift] - prev) + prev; } shift--; } return(0); } Can you input sound alarm to be played when the indicator goes above 1% line and when goes below the 99% line (or when is between 1-10% line and when is between 99-90% line), plese? Thank you. |
|
||||
|
Quote:
Programing skils for sale. List of EA programmers |
|
|||
|
|||
|
Alert for indicator
Hello All,
I'm hoping someone can figure out how to add an alert to this indicator. I really enjoying reading all the posts and the team work from everyone here. Thanks. #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_width1 2 #property indicator_color2 Lime #property indicator_width2 2 extern int SignalGap = 4; int dist=24; double b1[]; double b2[]; int init() { SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1); SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1); SetIndexArrow(1,233); SetIndexArrow(0,234); SetIndexBuffer(0,b1); SetIndexBuffer(1,b2); return(0); } int start() { int counted_bars=IndicatorCounted(); int k,i,j,limit,hhb,llb; if (counted_bars<0) return(-1); if (counted_bars>0) counted_bars--; limit=Bars-1; if(counted_bars>=1) limit=Bars-counted_bars-1; if (limit<0) limit=0; for (i=limit;i>=0;i--) { hhb = Highest(NULL,0,MODE_HIGH,dist,i-dist/2); llb = Lowest(NULL,0,MODE_LOW,dist,i-dist/2); if (i==hhb) b1[i]=High[hhb]+SignalGap*Point; if (i==llb) b2[i]=Low[llb]-SignalGap*Point; } return(0); } |
|
|||
|
Quote:
Besides there is some example about icustom here for RSIFilter_v1 and NonLagMA_v5 indicators. |
|
|||
|
Quote:
I used the following: Code:
if (UseSound==1) PlaySound(NameFileSound);
if (TypeChart==1) Comment ("Buy signal at Ask=",Ask,", Bid=",Bid,", Date=",TimeToStr(CurTime(),TIME_DATE)," ",TimeHour(CurTime()),":",TimeMinute(CurTime())," Symbol=",Symbol()," Period=",Period());
}
Code:
extern bool UseSound = True; extern bool TypeChart = True; extern string NameFileSound = "alert.wav"; Besides I opened MetaEditor and it is written the following: "Function plays a sound file. The file must be located in the terminal_dir\sounds directory or in its subdirectory". So my be you forgot to place this sound file in right place? Last edited by newdigital; 10-12-2006 at 02:01 PM. |
![]() |
| Bookmarks |
| Tags |
| histogram, forex, ZUP_v1.mq4 |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
|
||||
| Posted By | For | Type | Date | |
| OzFx System:) - Page 639 | This thread | Refback | 06-21-2008 10:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 12:46 PM | |