Playsound Fuktion nur einmal klingen lassen?

Post Reply
Lima
Posts: 26
Joined: 17 Apr 2014 18:15

Playsound Fuktion nur einmal klingen lassen?

Post by Lima »

Hallo,

Ich habe folgendes programiert:

If ((MACD>MACD_MM)and (MACD>=0)) then
begin
PlaySound("Gong");
end

If ((MACD<MACD_MM) and (MACD<=0)) then
begin
PlaySound("Gong");
end

Problem dabei ist dass solange die Konditionen erfüllt sind, wird geklingelt. Ich will aber, dass nur einmal bei Erfüllung der Konditionen klingelt. Damit es wieder klingelt, muss es erstmal aus der Kondition kommen und dann wieder zurück. Ich brauche eine Art vom Merker.

Gibt es eine Möglichkeit sowas zu realisieren?

Vielen Dank in voraus.
User avatar
WHS Support
Posts: 2443
Joined: 14 Feb 2013 10:27

Re: Playsound Fuktion nur einmal klingen lassen?

Post by WHS Support »

Hallo Lima,

wie wäre es mit so etwas:

if (MACD >= MACD_MM) and CrossesAbove(MACD, 0) then Playsound("gong");
else if (MACD >= 0) and CrossesAbove(MACD, MACD_MM) then Playsound("gong");
else if (MACD <= MACD_MM) and CrossesBelow(MACD, 0) then Playsound("gong");
else if (MACD <= 0) and CrossesBelow(MACD, MACD_MM) then Playsound("gong");

Freundliche Grüße,
Timo
WH SelfInvest
cmbigboss
Posts: 22
Joined: 10 Sep 2013 09:26

Re: Playsound Fuktion nur einmal klingen lassen?

Post by cmbigboss »

Hallo Lima du kannst auch '' and isbarcompleted () '' einfügen, funktioniert dann auch. Gruß Carsten
Post Reply

Return to “WHS NANOTRADER - EXPRESS PROGRAMMING”