Help me About Market Range Alert

 

I have minor coding experience, 1 want a alert if pair goes on 100% average range, and everytime its breach it, it always alert me per tick. can anyone help me?

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

//| 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;

double alertTag;

if ( (DPR*Point) > (Range*Point) )

{if ( alertTag!=Time[0])

{PlaySound("news.wav");// buy wav

Alert(Symbol()," M",Period()," ", Symbol(), " Reach ",Range, " %" );}alertTag = Time[0];}

//----

return(0);

}

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

Please . . . .

 
Sory folks ^^
 
Any 1 Can Help me??
 
this could help you forex broker
 
  1. Use Src
  2. // int limit=Bars-counted_bars;
    int limit = Bars - 1 - counted_bars;
    // if(counted_bars>0) limit++;counted_bars--;
    for(int i=0; i<limit; i++)

  3. for(int i=0; i<limit; i++) double ADR = iATR(NULL,ATRtf,ATR,i)/Point;
    No braces for the For. Everything below should be inside the For. Not one line
  4. The alert should be for i=0 only
  5. AlertTag should be a datetime not a double and must be static
  6. Indent you code properly so you can see what is grouped with what.
 
WHRoeder:
  1. Use Src

  2. No braces for the For. Everything below should be inside the For. Not one line
  3. The alert should be for i=0 only
  4. AlertTag should be a datetime not a double and must be static
  5. Indent you code properly so you can see what is grouped with what.

Thanks Bro... Can you Write for the Alert Too? thanks before, i dont know anything because I just Copy paste from the other indicator coding... Many Thanks,
 
nozzgile:
Thanks Bro... Can you Write for the Alert Too? thanks before, i dont know anything because I just Copy paste from the other indicator coding...
No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.