
|

|
|
|
|
|
 |
|
|

huntergatherer
Junior Member
Registered: Apr 2008
Location:
Posts: 22
Status: OFFLINE
|
|

Bingo, I ran some test code and at minimum one alert is audible with a list of all triggered alerts with nothing missing. That will work!!
Wish I found the addToList function before I spent 3 days creating 20+ .wav files for everything I trade.
Thanks for the help Alexis.
|
|
|
|
|
|

|  |
 |
|
|

huntergatherer
Junior Member
Registered: Apr 2008
Location:
Posts: 22
Status: OFFLINE
|
|

Thanks for your input Doji3333 that would probably be a good solution.
Alexis, I was using 30000 as a reference to see if it represented milliseconds not iterations. Before my last post I used the 25 million in your example on down with no effect. I tried again after reading your recent post using larger numbers. A noticeable delay of 10 seconds kicks in using numbers over 100 million. So I opened 3 charts same indicator and set the iterations at 2, 100000000, 300000000 to see if they played the alert at different times and it works. Downside the eSignal app locks up during this delay. The alerts all play within a 20 second frame but the whole app is locked during. I have other apps running that continue to run but eSignal locks up until the alerts are played. CPU usage is high during the 20 second delay. I also used smaller combinations 2, 80000000, 200000000 which work but sometimes cut off the third alert. I'm using notify.wav and door.wav. I have the for loop code under getbarstate line. Is this locking the software? Is there a way to just delay the alert and not lock the software? If not this isn't going to work to well. I planned on using 3 minute wav files on numerous indictors.
Probably have to figure out something with a raw time function instead of a loop. Will a time function lock the software and increase CPU usage? Another idea might be to modify the pop up window function that lists alerts that are triggered. Is the pop-up list a global type list of all alerts or does it only handle 1 individual alert? Can a audible alert be attached to the function to where a single alert fires when the alert window opens which should list all the alerts that were fired without missing anything. That way I just need one audible alert then read the list to see which ones were triggered.
Last edited by huntergatherer on 07-29-2010 at 08:51 PM
|
|
|
|
|
|

|  |
 |
|
|

Doji3333
Senior Member

Registered: Oct 2002
Location: Big Bear, CA
Posts: 1451
Status: OFFLINE
|
|

my two cents are....
When I developed my MENT Speech app (years ago), I ran into the same problem. The solution I came up with was to stage the WAV files into a looping solution that knew the amount of time each wave file required. That way, I could call a WAV file, loop and wait for it to finish, then call another WAV file (with the alert feature).
I suggest you do something similar.
The way I would handle this is by building an "Alert Manager app" that used Global Values (passing Array's of objects) from the individual efs files that generate the alert. This way, when the Alert Manager gets 2 or 3+ alerts, it could stage them and process them as you require.
Sorry there is no better solution. As I understand it, if you call multiple alerts at the same time, esignal continues to cancel the previous calls and allows the most recent wav file to be played. I believe this is also a condition related to how the sound player is designed to work. In other words, multiple calls to play a sound result in the immediate cancellation of the preceding calls to play a sound - thus only the last sound requested is played.
Hope this helps??
__________________
Brad Matheny
eSignal Solution Provider since 2000
|
|
|
|
|
|

|  |
 |
|
|

Alexis C. Montenegro

Registered: Oct 2002
Location:
Posts: 18063
Status: OFFLINE
|
|

huntergatherer
| quote: | | ...no matter what I set "Delay" for there is no delay. The .wav is played immediately when the new bar is created. I'm using 30000 for the setting which I guess is 30000 milliseconds or 30 seconds. |
In your script the value of 30000 is not the amount of milliseconds but the number of iterations you have set for the loop. While the time it takes to execute that loop will depend on various factors [speed of your computer, etc] my guess is that it is in the order of a few hundred milliseconds which would be shorter than the length of the alerts hence not enough to prevent the sounds from cancelling each other out. If you look at the example I posted earlier you will see that I used 26,000,000 and 13,000,000 iterations to ensure that the sound alerts were enough apart to be heard individually.
If you are instead trying to separate the alerts by a set amount of time then I would reiterate my previous suggestion to search the forums as I believe someone has posted an example of how to do that
Alex
| quote: | Originally posted by huntergatherer
Alexis, Thanks for your help.
Avery told me v10 would play multiple alerts triggered at the same time. I upgraded from v8 and ran this test. I ran 4 charts same symbol and indicator with an alert. I used 4 different .wav files one for each indicator using a FunctionParemeter. When the event was triggered I should of heard all 4 .wavs at the same time but v10 did the same as v8. Only one .wav is audible. The others are triggered but you can't hear them. I disabled the audible alert and then could hear one of the remaing 3 and so on until the last chart played it's different .wav. The alerts are triggered but because there at the same time, at the creation of a new bar, only 1 .wav is audible. If I get a buy and stop exit alert at the same time from different markerts I want to hear both not just one. It's a basic function. Avery said they will investigate ????
I'm now trying to do a work around. This is what I have so far. I moved the loop to below the getbarstate line. The indicator draws correctly and plays the alert but no matter what I set "Delay" for there is no delay. The .wav is played immediately when the new bar is created. I'm using 30000 for the setting which I guess is 30000 milliseconds or 30 seconds. Do I have the loop in the wrong place? You were correct on the original code by Jasonk that was to insert a delay between 2 alerts. I thought it was adding a delay to the top alert which is what i'm trying to do. I'm going to use a FunctionParemeter so that I can adjust the delay for the alerts manually for the size .wav for each alert and hopefully dial them in so they all play. I also would like to only delay just the alert not the indicator if possible.| PHP: |
function main(Length1, Source1, Toggle, Chart, Delay, Params) {
if (vCCI1 == null) vCCI1 = new CCIStudy(Length1, Source1);
setShowTitleParameters(eval(Params));
if(getBarState()==BARSTATE_NEWBAR && isLastBarOnChart()){
for (var i = 0; i < Delay; i++) {
}
if (Toggle != "Off"){
if (Chart != "Off"){
if(vCCI1.getValue(CCIStudy.CCI,0)>=0 && vLastAlert1 != 1){
Alert.playSound("notify.wav");
vLastAlert1 = 1;}
if(vCCI1.getValue(CCIStudy.CCI,0)<0 && vLastAlert1 != 2){
Alert.playSound("door.wav");
vLastAlert1 = 2;
}}}
| |
|
|
|
|
|
|

|  |
 |
|
|

huntergatherer
Junior Member
Registered: Apr 2008
Location:
Posts: 22
Status: OFFLINE
|
|

Alexis, Thanks for your help.
Avery told me v10 would play multiple alerts triggered at the same time. I upgraded from v8 and ran this test. I ran 4 charts same symbol and indicator with an alert. I used 4 different .wav files one for each indicator using a FunctionParemeter. When the event was triggered I should of heard all 4 .wavs at the same time but v10 did the same as v8. Only one .wav is audible. The others are triggered but you can't hear them. I disabled the audible alert and then could hear one of the remaing 3 and so on until the last chart played it's different .wav. The alerts are triggered but because there at the same time, at the creation of a new bar, only 1 .wav is audible. If I get a buy and stop exit alert at the same time from different markerts I want to hear both not just one. It's a basic function. Avery said they will investigate ????
I'm now trying to do a work around. This is what I have so far. I moved the loop to below the getbarstate line. The indicator draws correctly and plays the alert but no matter what I set "Delay" for there is no delay. The .wav is played immediately when the new bar is created. I'm using 30000 for the setting which I guess is 30000 milliseconds or 30 seconds. Do I have the loop in the wrong place? You were correct on the original code by Jasonk that was to insert a delay between 2 alerts. I thought it was adding a delay to the top alert which is what i'm trying to do. I'm going to use a FunctionParemeter so that I can adjust the delay for the alerts manually for the size .wav for each alert and hopefully dial them in so they all play. I also would like to only delay just the alert not the indicator if possible. | PHP: |
function main(Length1, Source1, Toggle, Chart, Delay, Params) {
if (vCCI1 == null) vCCI1 = new CCIStudy(Length1, Source1);
setShowTitleParameters(eval(Params));
if(getBarState()==BARSTATE_NEWBAR && isLastBarOnChart()){
for (var i = 0; i < Delay; i++) {
}
if (Toggle != "Off"){
if (Chart != "Off"){
if(vCCI1.getValue(CCIStudy.CCI,0)>=0 && vLastAlert1 != 1){
Alert.playSound("notify.wav");
vLastAlert1 = 1;}
if(vCCI1.getValue(CCIStudy.CCI,0)<0 && vLastAlert1 != 2){
Alert.playSound("door.wav");
vLastAlert1 = 2;
}}}
|
Last edited by huntergatherer on 07-29-2010 at 09:01 AM
|
|
|
|
|
|

|  |
 |
| All times are GMT. The time now is 01:41 PM. |
 |
|
 |
|
|
|  |
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
|
|
|
|
|
| | |