Registered User Joined: 4/13/2014 Posts: 11
|
Reading through some old posts I have been unable to get the alert function to work.
Here is the test code I have made just to see if I can get the Alert file to play on a watchlist.
The below condition has been placed as a watchlist column and then scanned.
Any ideas as to what may be wrong?
===============================
If Me.isLastBar AndAlso (Price.close(0) - Price.Close(1)) / Price.Close(1) > .02 Then
pass
LokiStatic.PlaySound("c:\Alarm1.wav")
End If
===============================
|
Registered User Joined: 5/6/2014 Posts: 81
|
I have posted on this subject extensively:
http://forums.worden.com/default.aspx?g=posts&t=52507
and other postings as well.
Just do a search; posted by : pthegreat
hope it helps
|
Registered User Joined: 5/6/2014 Posts: 81
|
Just gave your code a quick test. this works for me:
If isLastBar Then
If (Price.close(0) - Price.Close(1)) / Price.Close(1) > .02 Then
'showmessage("test")
LokiStatic.PlaySound("c:\windows\media\notify.wav")
pass
End If
End If
I've had an issue once that it didn't want to play my wav file. replaced it with another, and it worked.
do a test with the windows "notify.wav" file. That one works for sure.
it should be in c:\windows\media
After you get this to work, you'll probably will run into the issue that it keeps playing the file over and over until the condition is false. If you want to have it play just once per bar then read my post above.
|
Registered User Joined: 4/13/2014 Posts: 11
|
After copying your file and then customizing it to meet my needs, the Alert works!
Thanks for your help and I will look at your other posts for how to limit the looping of the alert.
Thanks for replying and providing your other resources.
Much appreciated.
|