//+------------------------------------------------------------------+ //| Parabolic_Alert.mq4 | //| Original file name: Parabolic.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net/ | //| Modified to give audible alarm on reversal | //| Modified by Jim Arner, Sr. | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" //---- #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 clrDarkOrange //---- input parameters extern double Step=0.05; extern double Maximum=0.3; //---- buffers double SarBuffer[]; //---- int save_lastreverse; bool save_dirlong, save_dirshort; double save_start; double save_last_high; double save_last_low; double save_ep; double save_sar; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators IndicatorDigits(Digits); SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,158); SetIndexBuffer(0,SarBuffer); //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void SaveLastReverse(int last,int dir_l,int dir_s,double _start,double low,double high,double ep,double sar) { save_lastreverse=last; save_dirlong=dir_l; save_dirshort=dir_s; save_start=_start; save_last_low=low; save_last_high=high; save_ep=ep; save_sar=sar; } //+------------------------------------------------------------------+ //| Parabolic Sell And Reverse system | //+------------------------------------------------------------------+ int start() { static bool first=true; bool dirlong, dirshort; double Start,last_high,last_low; double ep,sar,price_low,price_high,price; int i,counted_bars=IndicatorCounted(); string TradeTime; //---- if(Bars<3) return(0); //---- initial settings i=Bars-4; if(counted_bars==0 || first) { first=false; dirlong=true; dirshort=false; Start=Step; last_high=-10000000.0; last_low=10000000.0; while(i>0) { save_lastreverse=i; price_low=Low[i]; if(last_low>price_low) last_low=price_low; price_high=High[i]; if(last_highHigh[i+1] && price_low>Low[i+1]) break; if(price_high=0) { price_low=Low[i]; price_high=High[i]; //--- check for reverse if(dirlong==true && price_low