//+------------------------------------------------------------------+ //| DPC Market Range Alert.mq4 | //| Copyright © 2010, MetaQuotes Software Corp. | //| http://wwwDeltaPrimeCapital.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2010, MetaQuotes Software Corp." #property link "http://wwwDeltaPrimeCapital.com" #property indicator_chart_window extern int ATR = 26; extern int ATRtf = PERIOD_D1; extern int Range = 100; int PrevAlertTime = 0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- int limit=Bars-counted_bars; if(counted_bars>0) limit++;counted_bars--; for(int i=0; i<limit; i++) double ADR = iATR(NULL,ATRtf,ATR,i)/Point; double DR = ( iHigh(NULL,ATRtf,0) - iLow(NULL,ATRtf,0) )/Point; double DPR = (DR/ADR)*100; if ( (DPR*Point) > (Range*Point) ) {if ( PrevAlertTime!=Time[0]) {PlaySound("news.wav");// buy wav Alert(Symbol()," M",Period()," ", Symbol(), " Reach ",Range, " %" );}PrevAlertTime = Time[0];} //---- return(0); } //+------------------------------------------------------------------+

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi. I have problem for making Alert if market goes 100% from Averange Range. it will always give alert if it reach it, i have a very minor MQL experiance (Newbie) and i need for the expert for Help me FIx this.. thanks for your cooperation.