//+------------------------------------------------------------------+ //| TrendLine Alert.mq4 | //| | //| Plays sound when Bid price crosses any trendline or | //| horizontal line. Feel free to modify if needed. | //| | //+------------------------------------------------------------------+ #property copyright "Gustavs" #property indicator_chart_window double prevbid=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators for (int i=0;ivalue) && (prevbid<=prevvalue)) || ((Bid=prevvalue))) { PlaySound("alert.wav"); } ObjectSet(name,OBJPROP_PRICE3,value); } } prevbid=Bid; //---- return(0); } //+------------------------------------------------------------------+