Here is the Code for Sound alert
Code: Select all
// Example: using the GetAppInfo(aiStrategyAuto) to monitor for an Automated Trading
// Strategy that gets turned off.
Variables:
IntraBarPersist PrevATSStatus(0), // Holds the status of the ATS at the previous update
atsStatus(0); // Holds the current ATS status
if (LastBarOnChart_s = True) then begin
atsStatus = GetAppInfo(aiStrategyAuto);
// If the current ATS Status is different from the previous, and the previous
// status was ON, give an sound alert.
if (atsStatus <> PrevATSStatus) and (PrevATSStatus = 1) then begin
PlaySound("C:\Temp\atsTurnedOff.wav");
end;
PrevATSStatus = atsStatus;
RecalcLastBarAfter(15); // Update every 15 seconds, even if the data feed stops updating
end;