ÿþindicator MACD_TrendMeter_signal; // made by Werner Voets for WHSelfinvest // // you can use this indicator as a signal generator // just use the "indicator alarms"-button and set them to generate a sound when eg. // MACD_TrendMeter_signal.buy > 0 // input Length1 = 5, Length2 = 35, Length3 = 15; draw buyline1("Buy", histogram, dark_green, 2), sellline1("Sell", histogram, dark_red, 2), bline2("Buy2", histogram, green, 1), sline2("Sell2", histogram, red, 1), xlongline("Exit Long", histogram, magenta, 1), xshortline("Exit Short", histogram, dark_cyan, 1) ; vars Value1 (series), Value2(series), Value3(series), lst = 0; begin Value1 := EMA(Close, Length1)-EMA(Close, Length2); Value2 := XAverage(value1,length3); Value3 := makeseries(front(close), back(close), 0); for lst := front(Value2)+2 to back(Value2) do begin // if value1 crosses over 0 then buy ("EL1") this bar at close; if ((Value1[lst] > Value3[lst]) and (Value1[lst-1] < Value3[lst-1])) then buyline1[lst] := 1 else buyline1[lst] := 0; // if value1 crosses under 0 then sell ("ES1") this bar at close; if ((Value1[lst] < Value3[lst]) and (Value1[lst-1] > Value3[lst-1])) then sellline1[lst] := -1 else sellline1[lst] := 0; // if value1>0 and value1 crosses over value2 then buy ("EL2") this bar at close; if ((Value1[lst] > 0) and (Value1[lst] > Value2[lst]) and (Value1[lst-1] < Value2[lst-1])) then bline2[lst] := 1 else bline2[lst] := 0; // if value1<0 and value1 crosses under value2 then sell ("ES2") this bar at close; if ((Value1[lst] < 0) and (Value1[lst] < Value2[lst]) and (Value1[lst-1] > Value2[lst-1])) then sline2[lst] := -1 else sline2[lst] := 0; // if value1>0 and value1 crosses under value2 then exitlong ("XL") this bar at close; if ((Value1[lst] > 0) and (Value1[lst] < Value2[lst]) and (Value1[lst-1] > Value2[lst-1])) then xlongline[lst] := 0.5 else xlongline[lst] := 0; // if value1<0 and value1 crosses over value2 then exitshort ("XS") this bar at close; if ((Value1[lst] < 0) and (Value1[lst] > Value2[lst]) and (Value1[lst-1] < Value2[lst-1])) then xshortline[lst] := -0.5 else xshortline[lst] := 0; end; end. /*{MACD Trendmeter, BTAC Visuele Analyse} Input:Length1(5),Length2(35),Length3(15); if value1 crosses over 0 then buy ("EL1") this bar at close; if value1>0 and value1 crosses over value2 then buy ("EL2") this bar at close; if value1>0 and value1 crosses under value2 then exitlong ("XL") this bar at close; if value1 crosses under 0 then sell ("ES1") this bar at close; if value1<0 and value1 crosses under value2 then sell ("ES2") this bar at close; if value1<0 and value1 crosses over value2 then exitshort ("XS") this bar at close;